opensanctions / opensanctions/poliloom

Backfill old supporting quotes to include spaces at element boundaries

Open
#147 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

loom
Dominant language
Python
Stars
22
Forks
2
PR merge metrics
No merged PRs in 30d

Description

After adding separator=" " to BeautifulSoup.get_text(), new quotes extracted by the LLM will have proper spaces at HTML element boundaries (e.g. "In office 27 March 2014" instead of "In office27 March 2014").

Old quotes in the database still have the merged format. The frontend highlighter handles both formats via its boundary space skipping logic, so highlighting still works. But it would be cleaner to normalize the old quotes.

Approach: For each source with archived HTML, re-extract text with get_text(separator=" "), then for each old quote find the corresponding span in the new text and update the property_references.supporting_quotes column.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the code that processes archived HTML and updates the property_references.supporting_quotes column. Re-extract each source with BeautifulSoup get_text(separator=" "), then match each old quote to its span in the new text. Done means archived sources have normalized supporting quotes while existing highlighting continues to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
database
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.