# HG changeset patch # User Shohei KOKUBO # Date 1393303425 -32400 # Node ID e211424ac950ee5ed361b8814c55783ad08fed6b # Parent a68dbdf9b4292bd4a60086bded964dcb4f5d8da0# Parent d1cffd6d88f68136bb9e06b5dbf2228b7dcb26a1 merge diff -r a68dbdf9b429 -r e211424ac950 example/regex_mas/main.cc --- a/example/regex_mas/main.cc Tue Feb 25 13:43:25 2014 +0900 +++ b/example/regex_mas/main.cc Tue Feb 25 13:43:45 2014 +0900 @@ -238,7 +238,7 @@ } for(int j = 0; j < search_word_len - 1; ++j){ - skip_table[(int)search_word[j]] = search_word_len - j - 1; + skip_table[search_word[j]] = search_word_len - j - 1; } return skip_table; } diff -r a68dbdf9b429 -r e211424ac950 example/regex_mas/ppe/Exec.cc --- a/example/regex_mas/ppe/Exec.cc Tue Feb 25 13:43:25 2014 +0900 +++ b/example/regex_mas/ppe/Exec.cc Tue Feb 25 13:43:45 2014 +0900 @@ -12,6 +12,25 @@ static int BM_method(unsigned char *text,int text_len, unsigned char *pattern,int sw_len,int *skip) { + +// int text_pointer = 0; +// int pattern_pointer = 0; +// int match_counter = 0; +// +// while (text_pointer < text_len && pattern_pointer < sw_len) { +// if (text[text_pointer] == pattern[pattern_pointer]) { +// text_pointer++; pattern_pointer++; +// if (pattern_pointer == sw_len) { +// match_counter++; +// text_pointer = text_pointer - pattern_pointer + 1; +// pattern_pointer = 0; +// } +// } else { +// text_pointer = text_pointer - pattern_pointer + 1; +// pattern_pointer = 0; +// } +// } + int i = sw_len - 1; int match_counter = 0;