예제 #1
0
            /// <summary>
            /// Returns sub Leaf with specified sign.
            /// Create sub Leaf if leaf with such sign doesn't exist.
            /// </summary>
            /// <param name="sign"></param>
            /// <returns></returns>
            protected Leaf2 GetOrAppendSubLeaf(char sign)
            {
                if (SubLeaves != null)
                {
                    if (SubLeaves.ContainsKey(sign))
                    {
                        return(SubLeaves[sign]);
                    }
                }
                else
                {
                    SubLeaves = new Dictionary <char, Leaf2>();
                }

                Leaf2 temp = new Leaf2();

                SubLeaves[sign] = temp;
                return(temp);
            }
예제 #2
0
            /// <summary>
            /// Adds AnCodes of all Flexia models satisfied to word.
            /// Also adds all ancodes of sub nodes.
            /// </summary>
            /// <param name="word">Right part of word.</param>
            /// <param name="result">List to add satisfied AnCodes.</param>
            public void FindInfo(SearchInfo searchInfo, string word)
            {
                FindFlex(searchInfo, word);

                if (word == string.Empty)
                {
                    return;
                }

                if (SubLeaves == null)
                {
                    return;
                }

                Leaf2 node = GetSubLeaf(word[0]);

                if (node != null)
                {
                    node.FindInfo(searchInfo, word.Length > 1 ? word.Substring(1) : string.Empty);
                }

                return;
            }