Lines Matching defs:fail
68 struct trie *fail; /* Aho-Corasick failure function. */
113 kwset->trie->fail = 0;
184 link->trie->fail = 0;
297 treefails (register struct tree const *tree, struct trie const *fail,
305 treefails(tree->llink, fail, recourse);
306 treefails(tree->rlink, fail, recourse);
310 while (fail)
312 link = fail->links;
320 tree->trie->fail = link->trie;
323 fail = fail->fail;
326 tree->trie->fail = recourse;
381 register struct trie *curr, *fail;
435 treefails(curr->links, curr->fail, kwset->trie);
439 for (fail = curr->fail; fail; fail = fail->fail)
441 /* If the current node has some outgoing edge that the fail
442 doesn't, then the shift at the fail should be no larger
444 if (!hasevery(fail->links, curr->links))
445 if (curr->depth - fail->depth < fail->shift)
446 fail->shift = curr->depth - fail->depth;
449 fail and its descendents should be no larger than the
451 if (curr->accepting && fail->maxshift > curr->depth - fail->depth)
452 fail->maxshift = curr->depth - fail->depth;