Fix Camera keyword search with HTML entities#64
Merged
Conversation
|
| Filename | Overview |
|---|---|
| src/core/html-entity-variants.ts | Adds a keyword variant helper that keeps the original input and adds a named-entity encoded form. |
| src/tools/bills.ts | Expands Camera bills keyword filtering to check both original and HTML-entity keyword forms. |
| src/tools/bill-progress.ts | Expands bill-progress keyword filtering to check both original and HTML-entity keyword forms. |
| src/tools/tools.test.ts | Adds regression tests for decoded Camera keyword searches against ac19_2696. |
| LOG.md | Documents the Camera HTML-entity keyword search fix. |
Reviews (1): Last reviewed commit: "fix camera keyword html entities" | Re-trigger Greptile
There was a problem hiding this comment.
Pull request overview
This PR fixes Camera keyword searches when the underlying LOD literals contain HTML entities (e.g. criminalità) by searching both the user-provided keyword and an HTML-entity-encoded variant, and adds integration regressions to prevent the issue from returning.
Changes:
- Add
htmlEntityKeywordVariants()helper to generate decoded + HTML-entity encoded keyword variants for SPARQL filters. - Update Camera keyword filtering in
billsand inbill-progress(including Camera timeline mode) to match either variant. - Add regression tests targeting Camera act
ac19_2696, plus a LOG entry documenting the fix.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/tools/tools.test.ts | Adds regression coverage for keyword searches against Camera HTML-entity titles. |
| src/tools/bills.ts | Updates Camera bills keyword SPARQL filter to match both decoded and HTML-entity variants. |
| src/tools/bill-progress.ts | Extends keyword filtering to handle HTML-entity variants in both Senato list and Camera timeline paths. |
| src/core/html-entity-variants.ts | Introduces shared helper to generate HTML-entity keyword variants. |
| LOG.md | Documents the fix and verification steps/results. |
Comment on lines
+17
to
+26
| "\u00e0": "à", | ||
| "\u00e8": "è", | ||
| "\u00e9": "é", | ||
| "\u00ec": "ì", | ||
| "\u00f2": "ò", | ||
| "\u00f9": "ù", | ||
| }; | ||
|
|
||
| const HTML_ENTITY_CHARS = /["'&<>\u2018\u2019\u201c\u201d\u2013\u2014\u2026\u20ac\u00ab\u00bb\u00e0\u00e8\u00e9\u00ec\u00f2\u00f9]/g; | ||
|
|
| const result = await billsTool.execute({ | ||
| legislature: 19, | ||
| keyword: "criminalità", | ||
| limit: 10, |
aborruso
added a commit
that referenced
this pull request
Jul 13, 2026
…65) Recepiti due rilievi Copilot sulla PR #64: - htmlEntityKeywordVariants ora mappa anche À/È/É/Ì/Ò/Ù → la variante encoded viene generata pure con keyword maiuscola (es. CRIMINALITÀ) - test di regressione keyword: limit 10 → 100 (fragile all'ordinamento, 19 atti matchano) + nuovo caso maiuscolo Bump versione 0.25.2 nei 5 punti. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bills --keywordfor Camera titles/labels stored as HTML entities (e.g.criminalitàvscriminalità).bill-progresskeyword filters, including Camera timeline mode.ac19_2696.Verification
node dist/cli.js bills list --legislature 19 --keyword "criminalità" --limit 1 --format jsonlnode dist/cli.js bill-progress list --uri http://dati.camera.it/ocd/attocamera.rdf/ac19_2696 --keyword "criminalità" --limit 1 --format jsonlnpx vitest run --pool forksnpx tsc --noEmit