• Home
  • Raw
  • Download

Lines Matching refs:pattern_length

89     int pattern_length = pattern_.length();  in StringSearch()  local
90 if (pattern_length < kBMMinPatternLength) { in StringSearch()
91 if (pattern_length == 1) { in StringSearch()
276 int pattern_length = pattern.length(); in LinearSearch() local
279 int n = subject.length() - pattern_length; in LinearSearch()
295 pattern_length - 1)) { in LinearSearch()
313 int pattern_length = pattern.length(); in BoyerMooreSearch() local
320 PatternChar last_char = pattern[pattern_length - 1]; in BoyerMooreSearch()
323 while (index <= subject_length - pattern_length) { in BoyerMooreSearch()
324 int j = pattern_length - 1; in BoyerMooreSearch()
330 if (index > subject_length - pattern_length) { in BoyerMooreSearch()
340 index += pattern_length - 1 in BoyerMooreSearch()
361 int pattern_length = pattern_.length(); in PopulateBoyerMooreTable() local
366 int length = pattern_length - start; in PopulateBoyerMooreTable()
374 for (int i = start; i < pattern_length; i++) { in PopulateBoyerMooreTable()
377 shift_table[pattern_length] = 1; in PopulateBoyerMooreTable()
378 suffix_table[pattern_length] = pattern_length + 1; in PopulateBoyerMooreTable()
380 if (pattern_length <= start) { in PopulateBoyerMooreTable()
385 PatternChar last_char = pattern[pattern_length - 1]; in PopulateBoyerMooreTable()
386 int suffix = pattern_length + 1; in PopulateBoyerMooreTable()
388 int i = pattern_length; in PopulateBoyerMooreTable()
391 while (suffix <= pattern_length && c != pattern[suffix - 1]) { in PopulateBoyerMooreTable()
398 if (suffix == pattern_length) { in PopulateBoyerMooreTable()
401 if (shift_table[pattern_length] == length) { in PopulateBoyerMooreTable()
402 shift_table[pattern_length] = pattern_length - i; in PopulateBoyerMooreTable()
404 suffix_table[--i] = pattern_length; in PopulateBoyerMooreTable()
413 if (suffix < pattern_length) { in PopulateBoyerMooreTable()
414 for (int i = start; i <= pattern_length; i++) { in PopulateBoyerMooreTable()
436 int pattern_length = pattern.length(); in BoyerMooreHorspoolSearch() local
438 int badness = -pattern_length; in BoyerMooreHorspoolSearch()
441 PatternChar last_char = pattern[pattern_length - 1]; in BoyerMooreHorspoolSearch()
442 int last_char_shift = pattern_length - 1 - in BoyerMooreHorspoolSearch()
446 while (index <= subject_length - pattern_length) { in BoyerMooreHorspoolSearch()
447 int j = pattern_length - 1; in BoyerMooreHorspoolSearch()
454 if (index > subject_length - pattern_length) { in BoyerMooreHorspoolSearch()
468 badness += (pattern_length - j) - last_char_shift; in BoyerMooreHorspoolSearch()
482 int pattern_length = pattern_.length(); in PopulateBoyerMooreHorspoolTable() local
501 for (int i = start; i < pattern_length - 1; i++) { in PopulateBoyerMooreHorspoolTable()
520 int pattern_length = pattern.length(); in InitialSearch() local
524 int badness = -10 - (pattern_length << 2); in InitialSearch()
529 for (int i = index, n = subject.length() - pattern_length; i <= n; i++) { in InitialSearch()
550 } while (j < pattern_length); in InitialSearch()
551 if (j == pattern_length) { in InitialSearch()