Skip to content

Commit

Permalink
comleted the detect-problems-from-file
Browse files Browse the repository at this point in the history
  • Loading branch information
jpbarrette committed Sep 15, 2007
1 parent fcf492e commit dd88e32
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion finenight/lisp/iadfa-test.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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")
Expand Down

0 comments on commit dd88e32

Please sign in to comment.