Пример #1
0
        public void Subsense()
        {
            LexEntry e   = MakeSimpleEntry();
            string   xml =
                @"  <entry id='flob'>
				  <sense id='opon_1' order='1'>
					  <subsense id='opon_1a' order='1'>
						<grammatical-info value='n'/>
						<gloss lang='en'>
						  <text>grand kin</text>
						</gloss>
						<definition>
						  <form lang='en'>
							<text>
							  grandparent, grandchild; reciprocal term of
							  plus or minus two generations
							</text>
						  </form>
						</definition>
					  </subsense>
					  <subsense id='opon_1b' order='2'>
						<grammatical-info value='n'/>
						<gloss lang='en'>
						  <text>ancestor</text>
						</gloss>
					  </subsense>
					</sense>
			</entry>"            ;

            LexSense sense = new LexSense();

            e.Senses.Add(sense);
            _builder.GetOrMakeSubsense(sense, new Extensible(), xml);
            _builder.FinishEntry(e);
            _liftWriter.Add(e);
            _liftWriter.End();
            AssertHasAtLeastOneMatch("//entry/sense/subsense[@id='opon_1b' and @order='2']/gloss");
            AssertHasAtLeastOneMatch("//entry/sense/subsense/grammatical-info");
        }
Пример #2
0
        public void NewEntry_HasSemanticDomainWithTextualLabel_CorrectlyAddsSemanticDomain()
        {
            Extensible extensibleInfo = new Extensible();
            LexEntry   e = _builder.GetOrMakeEntry(extensibleInfo, 0);
            LexSense   s = _builder.GetOrMakeSense(e, new Extensible(), string.Empty);

            var t = new Trait("semantic-domain-ddp4",             //the name has migrated up to this already
                              "4.2.7");

            _builder.MergeInTrait(s, t);
            _builder.FinishEntry(e);
            var property = e.Senses[0].GetProperty <OptionRefCollection>(LexSense.WellKnownProperties.SemanticDomainDdp4);

            Assert.AreEqual("4.2.7 Play, fun", property.KeyAtIndex(0));
        }