LevenshteinAutomaton.TrieNode.GetChild C# (CSharp) 메소드

GetChild() 공개 메소드

Get node for given word or prefix if exists
public GetChild ( String wordOrPrefix ) : TrieNode
wordOrPrefix String
리턴 TrieNode
		public TrieNode GetChild(String wordOrPrefix)
		{            
			return string.IsNullOrEmpty(wordOrPrefix) ? null : GetChild(wordOrPrefix.ToCharArray());
		}

Same methods

TrieNode::GetChild ( char letter ) : TrieNode

Usage Example

예제 #1
0
        /// <summary>
        /// Get node for given char array
        /// </summary>
        public TrieNode GetChild(char[] letters)
        {
            TrieNode currentNode = this;

            for (int i = 0; i < letters.Length && currentNode != null; i++)
            {
                currentNode = currentNode.GetChild(letters[i]);
                if (currentNode == null)
                {
                    return(null);
                }
            }
            return(currentNode);
        }
All Usage Examples Of LevenshteinAutomaton.TrieNode::GetChild