From dd88e3220a5f85760903b143f278a8df2658cc11 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Barrette-LaPierre Date: Sat, 15 Sep 2007 11:03:51 -0400 Subject: [PATCH] comleted the detect-problems-from-file --- finenight/lisp/iadfa-test.lisp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/finenight/lisp/iadfa-test.lisp b/finenight/lisp/iadfa-test.lisp index 6834013..05ad7e7 100644 --- a/finenight/lisp/iadfa-test.lisp +++ b/finenight/lisp/iadfa-test.lisp @@ -51,6 +51,20 @@ (return (cons last-word wtbc))) (setf last-word (car wtbc)) (setf wtbc (cdr wtbc))))) + +(defun filter-non-problematic-words (words-to-be-checked) + (let ((problematics-words (list (car words-to-be-checked))) + (last-word (cadr words-to-be-checked)) + (words-to-be-checked (cddr words-to-be-checked))) + (do ((iadfa (gen-iadfa (append problematics-words words-to-be-checked)) + (gen-iadfa (append problematics-words words-to-be-checked)))) + ((null words-to-be-checked)) + (if (equal (append problematics-words words-to-be-checked) + (extract-words (iadfa-fsa iadfa))) + (setf problematics-words (nconc problematics-words (list last-word)))) + (setf last-word (car words-to-be-checked)) + (setf words-to-be-checked (cdr words-to-be-checked))) + problematics-words)) (defun detect-problems-from-file (filename) @@ -66,7 +80,12 @@ ;; We got the first entry that trigger the problem. ;; we need now to see which entry is needed to start ;; the problem - (detect-first-starting-problematic-word words-to-be-checked))) + (setf words-to-be-checked + (detect-first-starting-problematic-word words-to-be-checked)) + (setf words-to-be-checked + (filter-non-problematic-words words-to-be-checked)) + words-to-be-checked)) + (detect-problems-from-file "../../data/com.zone.sorted.small")