Пример #1
0
        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;
        }
Пример #2
0
        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;
        }
Пример #3
0
        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);
                    }
                }
            }
        }
Пример #4
0
        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);
                }
            }
        }