public override void ProcessSentence(Sentence sentence) { _sentence = sentence; Debug.Assert(sentence.WordList != null); Debug.Assert(sentence.WordList.Count > 0); // подлежащие. часть1 foreach (SentenceWord word in sentence.WordList.FindAll(x => (x.Link.Value == LinkType.Predic.Value || x.Link.Value == LinkType.DatSubject.Value ))) { Stage1ResultElement item = new Stage1ResultElement(); item.CopyFromSourceWord(word); item.ObjectType = ObjectType.Subject; item.ObjectKind = ObjectKind.Main; Result.Items.Add(item); } //сказуемые foreach (SentenceWord word in sentence.WordList.FindAll(x => (x.DOM == SentenceWord.DOMRoot /*&& (x.PartOfSpeech.Value == PartOfSpeech.Verb.Value || x.IsAuxVerb)*/) || x.Link.Value == LinkType.SentSoch.Value || (x.Link.Value == LinkType.PodchSouz.Value && (x.PartOfSpeech.Value == PartOfSpeech.Verb.Value || x.IsAuxVerb)) || x.Link.Value == LinkType.InfSouz.Value || x.Link.Value == LinkType.Eksplet.Value || x.Link.Value == LinkType.Relyat.Value )) { Stage1ResultElement item = new Stage1ResultElement(); item.CopyFromSourceWord(word); item.ObjectType = ObjectType.Predicate; item.ObjectKind = ObjectKind.Main; Result.Items.Add(item); } }
public void CopyFromSourceWord(Stage1ResultElement sourceWord) { base.CopyFromSourceWord(sourceWord); ObjectKind = sourceWord.ObjectKind; ObjectType = sourceWord.ObjectType; }