本文整理汇总了C#中LexSense.GetProperty方法的典型用法代码示例。如果您正苦于以下问题:C# LexSense.GetProperty方法的具体用法?C# LexSense.GetProperty怎么用?C# LexSense.GetProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LexSense
的用法示例。
在下文中一共展示了LexSense.GetProperty方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SenseGetsRelation
public void SenseGetsRelation()
{
LexSense sense = new LexSense();
_builder.MergeInRelation(sense, "synonym", "foo", null);
LexRelationCollection synonyms = sense.GetProperty<LexRelationCollection>("synonym");
LexRelation relation = synonyms.Relations[0];
Assert.AreEqual("synonym", relation.FieldId);
Assert.AreEqual("foo", relation.Key);
}
示例2: SenseGetsGrammi
public void SenseGetsGrammi()
{
LexSense sense = new LexSense();
_builder.MergeInGrammaticalInfo(sense, "red", null);
OptionRef optionRef =
sense.GetProperty<OptionRef>(LexSense.WellKnownProperties.PartOfSpeech);
Assert.IsNotNull(optionRef);
Assert.AreEqual("red", optionRef.Value);
}
示例3: GrammiGetsFlagTrait
public void GrammiGetsFlagTrait()
{
LexSense sense = new LexSense();
_builder.MergeInGrammaticalInfo(sense,
"red",
new List<Trait>(new Trait[] {new Trait("flag", "1")}));
OptionRef optionRef =
sense.GetProperty<OptionRef>(LexSense.WellKnownProperties.PartOfSpeech);
Assert.IsTrue(optionRef.IsStarred);
}
示例4: MultipleNotesCombined
public void MultipleNotesCombined()
{
LexSense sense = new LexSense();
_builder.MergeInNote(sense, null, MakeBasicLiftMultiText());
LiftMultiText secondNote = new LiftMultiText();
secondNote.Add("ws-one", "UNO");
secondNote.Add("ws-three", "tres");
_builder.MergeInNote(sense, null, secondNote);
MultiText mt = sense.GetProperty<MultiText>(WeSayDataObject.WellKnownProperties.Note);
Assert.AreEqual(3, mt.Forms.Length);
Assert.AreEqual("uno || UNO", mt["ws-one"]);
}