예제 #1
0
 public ISearchResult[] FindAll(string text)
 {
     if (charStateMachine == null)
     {
         KeywordTree tree = new KeywordTree(_keys);
         charStateMachine = tree.BuildStateMachine();
     }
     return charStateMachine.FindAll(text.ToCharArray());
 }
예제 #2
0
 public ISearchResult SearchChars(char[] text, int textStart, int textEnd)
 {
     if (charStateMachine == null)
     {
         KeywordTree tree = new KeywordTree(_keys);
         charStateMachine = tree.BuildStateMachine();
     }
     return charStateMachine.Find(text);
 }
예제 #3
0
        public static ISetSearch GetSetStateMachine(string[] keys)
        {
            if (keys == null)
                throw new ArgumentNullException();
            if (keys.Length == 0)
                throw new ArgumentOutOfRangeException();

            KeywordTree keywordTree = new KeywordTree(keys);
            return keywordTree.BuildStateMachine();
        }