feature/better-search #3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/better-search"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
normalize(): lowercase → NFD decompose → strip combining marks → collapse punctuation to spaces. Métacam®, METACAM and metacam all produce "metacam". jaroWinkler(): standard Jaro-Winkler similarity with 0.1 prefix weight. Weights shared prefixes heavily, which matches how drug-name typos behave in practice ("metcam" vs "metacam"). No new dependencies — java.text.Normalizer is part of the JDK. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>MedicationListScreen receives fuzzyMedications separately from medications. When non-empty, a centred label between two HorizontalDividers separates exact/ranked results from approximate (Jaro-Winkler) ones, so approximate matches are never mistaken for exact ones. Strings added in both FR ("Résultats similaires") and NL ("Gelijkaardige resultaten"). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>Drug names are long multi-word strings like "Métacam 5 mg/mL, solution injectable". Jaro-Winkler("metcam", full_name) ≈ 0.74 because the match count is divided by the full string length — so typo queries never cleared the 0.85 threshold. Comparing against each name token separately (taking the max) gives JW("metcam", "metacam") ≈ 0.93, which correctly surfaces the drug under "Résultats similaires". Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>