Add smart grammar morphology engine with multi-platform word forms su…#33
Merged
Conversation
…pport Extract POS tags from Grid 3 gridsets and generate morphological inflections (go→goes/going/gone/went, book→books) for vocabulary coverage analysis. New modules: - MorphologyEngine: built-in English rules + pluggable locale rule sets - Grid3VerbsParser: reads Grid 3 verbs.zip morphology data for 24+ locales, supports custom directories via parseCustomDirectory() and GRID3_MORPHOLOGY_DIR - WordFormGenerator: bridges Grid 3 POS data to AsTeRICS Grid tag-based word forms for cross-platform conversion Changes: - Add pos and wordForms fields to AACButton model - GridsetProcessor extracts POS from Action.InsertText commands - AstericsGridProcessor preserves word forms and GridActionWordForm actions on import/export (previously discarded) - MetricsCalculator auto-detects POS tags (enabled for Grid 3, zero-cost for Snap/TouchChat/OBF) - VocabularyAnalyzer.hasWord() checks inflected word forms - All tests use synthetic XML fixture (no Grid 3 dependency for CI)
Builds maps of POS tags and prediction lists from all tree pages, then propagate POS tags to metrics buttons that lack them. For POS-tagged tree buttons with predictions that aren't present in the BFS-reachable metrics set, create synthetic ButtonMetrics (high effort/depth) so their word forms can still be generated. Also fall back to a label-based lookup when resolving a button's parent metrics. This ensures POS and prediction data from topic/unreachable pages are included in metric calculations.
Three issues addressed: 1. POS-tagged buttons on BFS-unreachable pages (e.g. topic pages) were ignored because calculateWordFormMetrics required a matching metrics entry. Now creates synthetic entries for unreachable POS-tagged buttons and also looks up parents by label as a fallback. 2. POS tags from tree buttons are now propagated to metrics buttons when the metrics version lacks POS (e.g. the BFS finds a button on a page without POS but the same word exists with POS on another page). 3. Buttons without POS tags now get POS inference: checks the irregular tables first for confident assignment (Verb/Noun/Adjective/Pronoun), then defaults to Noun for untagged single-word content labels. This fixes coverage for words like "bird", "tree", "cloud", "thing" that exist only on topic pages without POS tagging. A skiplist prevents function words from being incorrectly tagged. Also adds MorphologyEngine.inferPOS() method for POS lookup against irregular tables. Co-Authored-By: Claude Opus 4.6 <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.
…pport
Extract POS tags from Grid 3 gridsets and generate morphological inflections (go→goes/going/gone/went, book→books) for vocabulary coverage analysis.
New modules:
Changes: