Esempio n. 1
0
        private void Find(TextTrieMap.CharacterNode node, String text, int start,
                          int index, TextTrieMap.ResultHandler handler)
        {
            IIterator itr = node.Iterator();

            if (itr != null)
            {
                if (!handler.HandlePrefixMatch(index - start, itr))
                {
                    return;
                }
            }
            if (index < text.Length)
            {
                IList childNodes = node.GetChildNodes();
                if (childNodes == null)
                {
                    return;
                }
                int ch    = IBM.ICU.Text.UTF16.CharAt(text, index);
                int chLen = IBM.ICU.Text.UTF16.GetCharCount(ch);
                for (int i = 0; i < childNodes.Count; i++)
                {
                    TextTrieMap.CharacterNode child = (TextTrieMap.CharacterNode)childNodes[i];
                    if (Compare(ch, child.GetCharacter()))
                    {
                        Find(child, text, start, index + chLen, handler);
                        break;
                    }
                }
            }
        }
Esempio n. 2
0
 public void Find(String text, int start, TextTrieMap.ResultHandler handler)
 {
     Find(root, text, start, start, handler);
 }
Esempio n. 3
0
 public void Find(String text, TextTrieMap.ResultHandler handler)
 {
     Find(text, 0, handler);
 }