Lines Matching refs:fail
67 struct trie *fail; /* Aho-Corasick failure function. */
112 kwset->trie->fail = 0;
183 link->trie->fail = 0;
296 treefails (register struct tree const *tree, struct trie const *fail,
304 treefails(tree->llink, fail, recourse);
305 treefails(tree->rlink, fail, recourse);
309 while (fail)
311 link = fail->links;
319 tree->trie->fail = link->trie;
322 fail = fail->fail;
325 tree->trie->fail = recourse;
380 register struct trie *curr, *fail;
434 treefails(curr->links, curr->fail, kwset->trie);
438 for (fail = curr->fail; fail; fail = fail->fail)
440 /* If the current node has some outgoing edge that the fail
441 doesn't, then the shift at the fail should be no larger
443 if (!hasevery(fail->links, curr->links))
444 if (curr->depth - fail->depth < fail->shift)
445 fail->shift = curr->depth - fail->depth;
448 fail and its descendents should be no larger than the
450 if (curr->accepting && fail->maxshift > curr->depth - fail->depth)
451 fail->maxshift = curr->depth - fail->depth;