393 |
of the hairy commentz-walter algorithm. */ |
of the hairy commentz-walter algorithm. */ |
394 |
if (kwset->words == 1 && kwset->trans == NULL) |
if (kwset->words == 1 && kwset->trans == NULL) |
395 |
{ |
{ |
396 |
|
char c; |
397 |
|
|
398 |
/* Looking for just one string. Extract it from the trie. */ |
/* Looking for just one string. Extract it from the trie. */ |
399 |
kwset->target = obstack_alloc(&kwset->obstack, kwset->mind); |
kwset->target = obstack_alloc(&kwset->obstack, kwset->mind); |
400 |
for (i = kwset->mind - 1, curr = kwset->trie; i >= 0; --i) |
for (i = kwset->mind - 1, curr = kwset->trie; i >= 0; --i) |
408 |
kwset->mind2 = kwset->mind; |
kwset->mind2 = kwset->mind; |
409 |
/* Find the minimal delta2 shift that we might make after |
/* Find the minimal delta2 shift that we might make after |
410 |
a backwards match has failed. */ |
a backwards match has failed. */ |
411 |
for (i = 0; i < kwset->mind - 1; ++i) |
c = kwset->target[kwset->mind - 1]; |
412 |
if (kwset->target[i] == kwset->target[kwset->mind - 1]) |
for (i = kwset->mind - 2; i >= 0; --i) |
413 |
kwset->mind2 = kwset->mind - (i + 1); |
if (kwset->target[i] == c) |
414 |
|
break; |
415 |
|
kwset->mind2 = kwset->mind - (i + 1); |
416 |
} |
} |
417 |
else |
else |
418 |
{ |
{ |