Home | History | Annotate | Download | only in src

Lines Matching defs:Search

36 // String Search object.
39 // Class holding constants and methods that apply to all string search variants,
45 // search will not be optimal, since we only build tables for a suffix
55 // there is no search speed degradation.
101 int Search(Vector<const SubjectChar> subject, int index) {
128 static int SingleCharSearch(StringSearch<PatternChar, SubjectChar>* search,
132 static int LinearSearch(StringSearch<PatternChar, SubjectChar>* search,
136 static int InitialSearch(StringSearch<PatternChar, SubjectChar>* search,
141 StringSearch<PatternChar, SubjectChar>* search,
145 static int BoyerMooreSearch(StringSearch<PatternChar, SubjectChar>* search,
196 // The pattern to search for.
198 // Pointer to implementation of the search.
206 // Single Character Pattern Search Strategy
211 StringSearch<PatternChar, SubjectChar>* search,
214 ASSERT_EQ(1, search->pattern_.length());
215 PatternChar pattern_first_char = search->pattern_[0];
240 // Linear Search Strategy
260 // Simple linear search for short patterns. Never bails out.
263 StringSearch<PatternChar, SubjectChar>* search,
266 Vector<const PatternChar> pattern = search->pattern_;
295 // Boyer-Moore string search
300 StringSearch<PatternChar, SubjectChar>* search,
303 Vector<const PatternChar> pattern = search->pattern_;
307 int start = search->start_;
309 int* bad_char_occurence = search->bad_char_table();
310 int* good_suffix_shift = search->good_suffix_shift_table();
314 // Continue search from i.
418 // Boyer-Moore-Horspool string search.
423 StringSearch<PatternChar, SubjectChar>* search,
426 Vector<const PatternChar> pattern = search->pattern_;
429 int* char_occurrences = search->bad_char_table();
436 // Perform search
462 search->PopulateBoyerMooreTable();
463 search->strategy_ = &BoyerMooreSearch;
464 return BoyerMooreSearch(search, subject, index);
501 // Linear string search with bailout to BMH.
504 // Simple linear search for short patterns, which bails out if the string
508 StringSearch<PatternChar, SubjectChar>* search,
511 Vector<const PatternChar> pattern = search->pattern_;
548 search->PopulateBoyerMooreHorspoolTable();
549 search->strategy_ = &BoyerMooreHorspoolSearch;
550 return BoyerMooreHorspoolSearch(search, subject, i);
557 // Perform a a single stand-alone search.
558 // If searching multiple times for the same pattern, a search
559 // object should be constructed once and the Search function then called
560 // for each search.
566 StringSearch<PatternChar, SubjectChar> search(isolate, pattern);
567 return search.Search(subject, start_index);