예제 #1
0
		public void InflectionClassIsRelevant()
		{
			CheckDisposed();

			LexEntry entry = new LexEntry ();
			Cache.LangProject.LexDbOA.EntriesOC.Add(entry);
			MoAffixAllomorph allomorph = new MoAffixAllomorph();
			entry.AlternateFormsOS.Append(allomorph);
			Assert.IsFalse(allomorph.IsFieldRelevant((int)MoAffixForm.MoAffixFormTags.kflidInflectionClasses),
				"InflectionClass should not be relevant until an inflectional affix MSA with a category has been added.");
			MoInflAffMsa orange = new MoInflAffMsa();
			entry.MorphoSyntaxAnalysesOC.Add(orange);
			Assert.IsFalse(allomorph.IsFieldRelevant((int)MoAffixForm.MoAffixFormTags.kflidInflectionClasses),
				"InflectionClass should not be relevant until an inflectional affix MSA with a category has been added.");
			PartOfSpeech pos = new PartOfSpeech();
			Cache.LangProject.PartsOfSpeechOA.PossibilitiesOS.Append(pos);
			orange.PartOfSpeechRA = pos;
			Assert.IsTrue(allomorph.IsFieldRelevant((int)MoAffixForm.MoAffixFormTags.kflidInflectionClasses),
				"InflectionClass should now be relevant since an inflectional affix MSA with a category has been added.");

		}
예제 #2
0
		public void InflectionClassInCompoundStemMsasIsRelevant()
		{
			CheckDisposed();

			MoExoCompound compound = new MoExoCompound();
			Cache.LangProject.MorphologicalDataOA.CompoundRulesOS.Append(compound);
			MoStemMsa msaLeft = new MoStemMsa();
			MoStemMsa msaRight = new MoStemMsa();
			MoStemMsa msaTo = new MoStemMsa();
			compound.LeftMsaOA = msaLeft;
			compound.RightMsaOA = msaRight;
			compound.ToMsaOA = msaTo;
			Assert.IsFalse(msaLeft.IsFieldRelevant((int)MoStemMsa.MoStemMsaTags.kflidInflectionClass),
				"Inflection Class should not be relevant for LeftMsa.");
			Assert.IsFalse(msaRight.IsFieldRelevant((int)MoStemMsa.MoStemMsaTags.kflidInflectionClass),
				"Inflection Class should not be relevant for RightMsa.");
			Assert.IsFalse(msaTo.IsFieldRelevant((int)MoStemMsa.MoStemMsaTags.kflidInflectionClass),
				"Inflection Class should not be relevant for ToMsa if it does not have a category.");
			PartOfSpeech pos = new PartOfSpeech();
			Cache.LangProject.PartsOfSpeechOA.PossibilitiesOS.Append(pos);
			msaTo.PartOfSpeechRA = pos;
			Assert.IsTrue(msaTo.IsFieldRelevant((int)MoStemMsa.MoStemMsaTags.kflidInflectionClass),
				"Inflection Class should be relevant for ToMsa when it has a category.");
		}