Mercurial > hg > Game > Cerium
changeset 1970:e211424ac950 draft
merge
author | Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 25 Feb 2014 13:43:45 +0900 |
parents | a68dbdf9b429 (current diff) d1cffd6d88f6 (diff) |
children | fdb3ed0bc51d |
files | |
diffstat | 2 files changed, 20 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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; }
--- 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;