[AI] Optimize word scoring normalization#32
Merged
Merged
Conversation
Contributor
Points performanceResultsPointsPerformance comparison
Language.points(for:) TimeMedian ns/word, lower is better.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #32 +/- ##
==========================================
- Coverage 93.75% 93.70% -0.05%
==========================================
Files 35 35
Lines 1840 1875 +35
==========================================
+ Hits 1725 1757 +32
- Misses 115 118 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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
Optimizes
Language.points(for:)by scoring lowercased Unicode scalars against precomputed scalar point tables and only applying canonical precomposition when decomposed combining marks are detected.Also precomposes sanitized word queries, adds scoring normalization coverage, tightens DAWG validator expectations to include scored
Wordordering, and introduces aScripts/points-performancebenchmark with PR CI reporting for scoring changes.Why
Word scoring runs on search results and needs to stay correct for composed and decomposed Unicode input without paying unnecessary normalization cost for common already-composed or ASCII words.
Impact
Scoring behavior is preserved for existing words while decomposed French and Polish characters now score consistently with their composed equivalents. Future changes to
Language.points(for:)get a dedicated benchmark script and automated PR performance comment when the scoring implementation changes.Validation
Adds unit tests for canonical precomposition in
Language.points(for:)andsanitizedWordQuery, updates DAWG validator tests to assert scoredWordresults, and adds the standaloneScripts/points-performancebenchmark plus CI integration.