Esempio n. 1
0
		public void FromPartsOfSpeechIsRelevant()
		{
			CheckDisposed();

			LexEntry entry = new LexEntry();
			Cache.LangProject.LexDbOA.EntriesOC.Add(entry);
			MoStemAllomorph allomorph = new MoStemAllomorph();
			entry.AlternateFormsOS.Append(allomorph);
			MoStemMsa msa = new MoStemMsa();
			entry.MorphoSyntaxAnalysesOC.Add(msa);
			SetMorphType(allomorph, MoMorphType.kguidMorphStem);
			Assert.IsFalse(msa.IsFieldRelevant((int)MoStemMsa.MoStemMsaTags.kflidFromPartsOfSpeech),
				"FromPartsOfSpeech should not be relevant until the entry contains a proclitic or an enclitic.");
			SetMorphType(allomorph, MoMorphType.kguidMorphProclitic);
			Assert.IsTrue(msa.IsFieldRelevant((int)MoStemMsa.MoStemMsaTags.kflidFromPartsOfSpeech),
				"FromPartsOfSpeech should now be relevant since the entry has a proclitic.");
			SetMorphType(allomorph, MoMorphType.kguidMorphEnclitic);
			Assert.IsTrue(msa.IsFieldRelevant((int)MoStemMsa.MoStemMsaTags.kflidFromPartsOfSpeech),
				"FromPartsOfSpeech should now be relevant since the entry has an enclitic.");
			SetMorphType(allomorph, MoMorphType.kguidMorphClitic);
			Assert.IsFalse(msa.IsFieldRelevant((int)MoStemMsa.MoStemMsaTags.kflidFromPartsOfSpeech),
				"FromPartsOfSpeech should not be relevant until the entry contains a proclitic or an enclitic.");
			SetMorphType(allomorph, MoMorphType.kguidMorphBoundRoot);
			Assert.IsFalse(msa.IsFieldRelevant((int)MoStemMsa.MoStemMsaTags.kflidFromPartsOfSpeech),
				"FromPartsOfSpeech should not be relevant until the entry contains a proclitic or an enclitic.");
			SetMorphType(allomorph, MoMorphType.kguidMorphBoundStem);
			Assert.IsFalse(msa.IsFieldRelevant((int)MoStemMsa.MoStemMsaTags.kflidFromPartsOfSpeech),
				"FromPartsOfSpeech should not be relevant until the entry contains a proclitic or an enclitic.");
			SetMorphType(allomorph, MoMorphType.kguidMorphCircumfix);
			Assert.IsFalse(msa.IsFieldRelevant((int)MoStemMsa.MoStemMsaTags.kflidFromPartsOfSpeech),
				"FromPartsOfSpeech should not be relevant until the entry contains a proclitic or an enclitic.");
			SetMorphType(allomorph, MoMorphType.kguidMorphDiscontiguousPhrase);
			Assert.IsFalse(msa.IsFieldRelevant((int)MoStemMsa.MoStemMsaTags.kflidFromPartsOfSpeech),
				"FromPartsOfSpeech should not be relevant until the entry contains a proclitic or an enclitic.");
			SetMorphType(allomorph, MoMorphType.kguidMorphInfix);
			Assert.IsFalse(msa.IsFieldRelevant((int)MoStemMsa.MoStemMsaTags.kflidFromPartsOfSpeech),
				"FromPartsOfSpeech should not be relevant until the entry contains a proclitic or an enclitic.");
			SetMorphType(allomorph, MoMorphType.kguidMorphInfixingInterfix);
			Assert.IsFalse(msa.IsFieldRelevant((int)MoStemMsa.MoStemMsaTags.kflidFromPartsOfSpeech),
				"FromPartsOfSpeech should not be relevant until the entry contains a proclitic or an enclitic.");
			SetMorphType(allomorph, MoMorphType.kguidMorphParticle);
			Assert.IsFalse(msa.IsFieldRelevant((int)MoStemMsa.MoStemMsaTags.kflidFromPartsOfSpeech),
				"FromPartsOfSpeech should not be relevant until the entry contains a proclitic or an enclitic.");
			SetMorphType(allomorph, MoMorphType.kguidMorphPhrase);
			Assert.IsFalse(msa.IsFieldRelevant((int)MoStemMsa.MoStemMsaTags.kflidFromPartsOfSpeech),
				"FromPartsOfSpeech should not be relevant until the entry contains a proclitic or an enclitic.");
			SetMorphType(allomorph, MoMorphType.kguidMorphPrefix);
			Assert.IsFalse(msa.IsFieldRelevant((int)MoStemMsa.MoStemMsaTags.kflidFromPartsOfSpeech),
				"FromPartsOfSpeech should not be relevant until the entry contains a proclitic or an enclitic.");
			SetMorphType(allomorph, MoMorphType.kguidMorphPrefixingInterfix);
			Assert.IsFalse(msa.IsFieldRelevant((int)MoStemMsa.MoStemMsaTags.kflidFromPartsOfSpeech),
				"FromPartsOfSpeech should not be relevant until the entry contains a proclitic or an enclitic.");
			SetMorphType(allomorph, MoMorphType.kguidMorphRoot);
			Assert.IsFalse(msa.IsFieldRelevant((int)MoStemMsa.MoStemMsaTags.kflidFromPartsOfSpeech),
				"FromPartsOfSpeech should not be relevant until the entry contains a proclitic or an enclitic.");
			SetMorphType(allomorph, MoMorphType.kguidMorphSimulfix);
			Assert.IsFalse(msa.IsFieldRelevant((int)MoStemMsa.MoStemMsaTags.kflidFromPartsOfSpeech),
				"FromPartsOfSpeech should not be relevant until the entry contains a proclitic or an enclitic.");
			SetMorphType(allomorph, MoMorphType.kguidMorphSuffix);
			Assert.IsFalse(msa.IsFieldRelevant((int)MoStemMsa.MoStemMsaTags.kflidFromPartsOfSpeech),
				"FromPartsOfSpeech should not be relevant until the entry contains a proclitic or an enclitic.");
			SetMorphType(allomorph, MoMorphType.kguidMorphSuffixingInterfix);
			Assert.IsFalse(msa.IsFieldRelevant((int)MoStemMsa.MoStemMsaTags.kflidFromPartsOfSpeech),
				"FromPartsOfSpeech should not be relevant until the entry contains a proclitic or an enclitic.");
			SetMorphType(allomorph, MoMorphType.kguidMorphSuprafix);
			Assert.IsFalse(msa.IsFieldRelevant((int)MoStemMsa.MoStemMsaTags.kflidFromPartsOfSpeech),
				"FromPartsOfSpeech should not be relevant until the entry contains a proclitic or an enclitic.");

		}
Esempio n. 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.");
		}