private void _addChildWords(ref INode<int> node, ref List<SentenceWord> sentenceWordList, int[] excludeIds, bool checkLinkType = true) { var localNode = node; foreach (var word in sentenceWordList.FindAll(x => x.DOM == localNode.Data)) { if (!excludeIds.Contains(word.Id)) { if (checkLinkType) { if ( !(word.Link.Value == LinkType.SentSoch.Value || word.Link.Value == LinkType.PodchSouz.Value || word.Link.Value == LinkType.InfSouz.Value || word.Link.Value == LinkType.Eksplet.Value || word.Link.Value == LinkType.Relyat.Value)) { var newNode = node.AddChild(word.Id); _addChildWords(ref newNode, ref sentenceWordList, excludeIds); } } else { var newNode = node.AddChild(word.Id); _addChildWords(ref newNode, ref sentenceWordList, excludeIds); } } } node = localNode; }
private void _addChildWords(ref INode<string> node, ref List<SentenceElement> sentenceWordList, string[] excludeIds) { var localNode = node; foreach (var word in sentenceWordList.FindAll(x => x.SyntacticParentWordId == localNode.Data)) { if (!excludeIds.Contains(word.Id)) { var newNode = node.AddChild(word.Id); _addChildWords(ref newNode, ref sentenceWordList, excludeIds); } } node = localNode; }
public void LoadChainList(int[] excludeIds, ref List<SentenceWord> sentenceWordList, bool checkLinkType = true, bool addSelf = false) { Debug.Assert(sentenceWordList != null); INode<int> newNode = null; if (addSelf) newNode = ChainWordsIds.AddChild(Id); foreach (var word in sentenceWordList.FindAll(x => x.DOM == Id)) { if (!excludeIds.Contains(word.Id)) { if (checkLinkType) { if (!(word.Link.Value == LinkType.SentSoch.Value || word.Link.Value == LinkType.PodchSouz.Value || word.Link.Value == LinkType.InfSouz.Value || word.Link.Value == LinkType.Eksplet.Value || word.Link.Value == LinkType.Relyat.Value)) { newNode = ChainWordsIds.AddChild(word.Id); _addChildWords(ref newNode, ref sentenceWordList, excludeIds); } } else { newNode = ChainWordsIds.AddChild(word.Id); _addChildWords(ref newNode, ref sentenceWordList, excludeIds, checkLinkType); } } } }
public void LoadChainList(string[] excludeIds, ref List<SentenceElement> sentenceWordList) { Debug.Assert(sentenceWordList != null); foreach (var word in sentenceWordList.FindAll(x => x.SyntacticParentWordId == Id)) { if (!excludeIds.Contains(word.Id)) { var newNode = ChainWordsIds.AddChild(word.Id); _addChildWords(ref newNode, ref sentenceWordList, excludeIds); } } }