示例#1
0
 /// <summary>Return all the PartOfSpeechBuilders descended from this that have indexes between <paramref name="start"/> and <paramref name="end"/>, non-inclusive.</summary>
 internal IEnumerable <PartOfSpeechBuilder> PartsOfSpeechInSubtreeBetween(PartOfSpeechBuilder start, PartOfSpeechBuilder end) => GetElementsOfTypeInSubtree <PartOfSpeechBuilder>()
 .Where(posb => posb.ComesAfter(start) && posb.ComesBefore(end));
示例#2
0
 /// <summary>Return the index of <paramref name="partOfSpeech"/> within the subtree of this</summary>
 public int RelativeIndexOf(PartOfSpeechBuilder partOfSpeech) => GetElementsOfTypeInSubtree <PartOfSpeechBuilder>()
 .OrderBy(partOfSpeech => partOfSpeech)
 .ToList()
 .IndexOf(partOfSpeech) + 1;