Example #1
0
        Search CreateSearchObj(string pattern, SearchMode mode)
        {
            Search s = null;

            switch (mode)
            {
            case SearchMode.Text:
                s = new SearchText(pattern);
                //s.Pattern = pattern;
                break;

            case SearchMode.Regex:
                s = new SearchRegex(pattern);
                //s.Pattern = pattern;
                break;

            case SearchMode.Migemo:
                s = new SearchMigemo(getMigemo().Query(pattern));
                //s.Pattern = getMigemo().Query(pattern);
                break;

            default:
                break;
            }
            return(s);
        }
Example #2
0
 Search CreateSearchObj(string pattern, SearchMode mode)
 {
     Search s = null;
     switch (mode) {
         case SearchMode.Text:
             s = new SearchText(pattern);
             //s.Pattern = pattern;
             break;
         case SearchMode.Regex:
             s = new SearchRegex(pattern);
             //s.Pattern = pattern;
             break;
         case SearchMode.Migemo:
             s = new SearchMigemo(getMigemo().Query(pattern));
             //s.Pattern = getMigemo().Query(pattern);
             break;
         default:
             break;
     }
     return s;
 }