Implement homograph numbers and improve entry search/sort behavior#2220
Implement homograph numbers and improve entry search/sort behavior#2220myieye wants to merge 8 commits intofeat/sync-morph-typesfrom
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThis PR implements homograph number support to track and distinguish multiple entries sharing the same headword. It adds the Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
4246a62 to
2e82fa6
Compare
e3ec8c7 to
87c5dad
Compare
8d2c6c6 to
b95da37
Compare
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
* Seed canonical morph-types into CRDT projects - Add CanonicalMorphTypes with all 19 morph-type definitions (GUIDs from LibLCM) - Seed morph-types for new projects via PreDefinedData.PredefinedMorphTypes - Seed morph-types for existing projects in MigrateDb (before FTS refresh) - Add EF migration to clear FTS table so headwords are rebuilt with morph tokens - Patch legacy snapshots (empty MorphTypes) in sync layer to prevent duplicates * Stop creating morph-types in tests. They're now prepopulated * Stop printing verify diff content. It's too much. * Seed morph types before API testing * Add descriptions to canonical morph types * Sync morph-types when importing, because they already exist in CRDT * Verify our canonical morph-types match new fwdata projects * Fix non-FTS relevance order with morph-tokens in query
87c5dad to
8ed192f
Compare
Add HomographNumber (int, 0 = unset) to the Entry model with full round-trip support through CRDT, FwData bridge, and sync. Key changes: - Entry model: add HomographNumber property with Copy() support - CreateEntryChange: persist HomographNumber in CRDT changes - CrdtMiniLcmApi: auto-assign homograph numbers on entry creation when HomographNumber is 0, respecting SecondaryOrder scoping. Updates existing lone entries from 0→1 when a second homograph appears. - FwDataMiniLcmApi: read HomographNumber from ILexEntry, set on create - UpdateEntryProxy: bidirectional HomographNumber sync to LibLCM - EntrySync: include HomographNumber in diff/patch operations - Sorting: uncomment HomographNumber in CRDT sort and search queries - Tests: uncomment sorting tests with HomographNumber, add auto- assignment tests, add sync test verifying LibLCM corrects numbers after entry deletion via two sync cycles https://claude.ai/code/session_01FJj2v135u6KdgVxoK4tRp2
aaf00bb to
0db4516
Compare
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
4be17e9 to
77a861f
Compare
8ed192f to
374b1b2
Compare
Summary
This PR implements homograph number auto-assignment for entries with duplicate headwords and significantly improves entry search and sorting behavior to properly handle morphological tokens and secondary ordering.
Key Changes
Homograph Number Management
HomographNumberproperty toEntrymodel to distinguish entries with identical headwordsCrdtMiniLcmApi.AssignHomographNumber()that:MorphType.SecondaryOrderSearch and Filtering Improvements
MorphType.SecondaryOrderto group related morphological variants togetherSorting Enhancements
ApplyHeadwordOrder()method to apply consistent headword-based sorting with secondary order considerationApplyRoughBestMatchOrder()to include secondary order and homograph number in sort criteriaData Model Changes
Headwordcomputed property toEntry(pre-computed by backend, populated during finalization)HeadwordWithTokens(),SearchHeadwords(),ComputeHeadwords()inEntryQueryHelpersEntrySearchService.FilterAndRank()to use new ranking logic with secondary order supportFiltering.csto acceptIQueryable<MorphType>for proper secondary order filteringTest Coverage
API Updates
EntrySearchService.Filter()to acceptWritingSystemIdparameterHeadword()method toHeadwordText()in various test helpers to distinguish from the newHeadwordpropertyNotable Implementation Details
Headwordproperty is computed by the backend and excluded from strict equality checks in sync testshttps://claude.ai/code/session_01FJj2v135u6KdgVxoK4tRp2