Repository navigation
Merge equivalent MSAs when loading HermitCrab #1148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
fd51700
c6b7755
cc961f3
05b26fe
edded8e
ca68e83
73c25ef
d200abc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -662,6 +662,42 @@ public void UnclassifedAffix() | |
| Assert.That(rule.IsPartial, Is.True); | ||
| } | ||
|
|
||
| [Test] | ||
| public void RepresentativeMSAs() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This covers affix merging. Proposed additional cases: Stem MSAs merge
Survivor is a referenced MSA (the Aweti
Variants
Different MSAs stay separate
Ad-hoc prohibition on a merged-away MSA
Saved analysis on a merged-away MSA
Option off
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added "Option off". I think that the unit test has coverage that is comparable to other features in HCLoaderTests, but you can add more tests if you want.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the option-off test. The one case I'd still like covered is the main path: two senses on |
||
| { | ||
| ILexEntry lexEntry = AddEntry(MoMorphTypeTags.kguidMorphSuffix, "ɯd", "gloss", new SandboxGenericMSA { MsaType = MsaType.kUnclassified, MainPOS = m_verb }); | ||
| var senseFactory = Cache.ServiceLocator.GetInstance<ILexSenseFactory>(); | ||
| var lexSense = senseFactory.Create(); | ||
| lexEntry.SensesOS.Add(lexSense); | ||
| IMoUnclassifiedAffixMsa msa = Cache.ServiceLocator.GetInstance<IMoUnclassifiedAffixMsaFactory>().Create(); | ||
| lexEntry.MorphoSyntaxAnalysesOC.Add(msa); | ||
| lexSense.MorphoSyntaxAnalysisRA = msa; | ||
| msa.PartOfSpeechRA = m_verb; | ||
|
|
||
| ILexEntry stemEntry = AddEntry(MoMorphTypeTags.kguidMorphStem, "a", "gloss", new SandboxGenericMSA { MsaType = MsaType.kStem }); | ||
| var stemSense = senseFactory.Create(); | ||
| stemEntry.SensesOS.Add(stemSense); | ||
| IMoStemMsa stemMsa = Cache.ServiceLocator.GetInstance<IMoStemMsaFactory>().Create(); | ||
| stemEntry.MorphoSyntaxAnalysesOC.Add(stemMsa); | ||
| stemSense.MorphoSyntaxAnalysisRA = stemMsa; | ||
|
|
||
| m_loadErrors.Clear(); | ||
| m_lang = HCLoader.Load(Cache, new TestHCLoadErrorLogger(m_loadErrors), out _); | ||
|
|
||
| Assert.That(m_lang.Strata[0].Entries.Count, Is.EqualTo(1)); | ||
| Assert.That(m_lang.Strata[0].MorphologicalRules.Count, Is.EqualTo(1)); | ||
| var rule = (AffixProcessRule)m_lang.Strata[0].MorphologicalRules[0]; | ||
|
|
||
| Assert.That(rule.RequiredSyntacticFeatureStruct.ToString(), Is.EqualTo("[POS:V]")); | ||
| Assert.That(rule.Gloss, Is.EqualTo("gloss")); | ||
| Assert.That(rule.IsPartial, Is.True); | ||
|
|
||
| m_loadErrors.Clear(); | ||
| m_lang = HCLoader.Load(Cache, new TestHCLoadErrorLogger(m_loadErrors)); | ||
| Assert.That(m_lang.Strata[0].Entries.Count, Is.EqualTo(2)); | ||
| Assert.That(m_lang.Strata[0].MorphologicalRules.Count, Is.EqualTo(2)); | ||
| } | ||
|
|
||
| [Test] | ||
| public void AffixNoMorphTypeSet() | ||
| { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.