Skip to content

Commit

Permalink
better output
Browse files Browse the repository at this point in the history
  • Loading branch information
jpbarrette committed Sep 18, 2007
1 parent b167323 commit f696b1a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion finenight/lisp/compile.lisp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(declaim (optimize (speed 3) (space 3) (debug 0)))
(declaim (optimize (safety 0) (speed 3) (space 3) (debug 0)))
;(declaim (optimize (speed 0) (space 0) (compilation-speed 0) (debug 3)))

(compile-file "package.lisp")
Expand Down
11 changes: 5 additions & 6 deletions finenight/lisp/iadfa-run.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@
(defun iadfa-run ()
(let* ((iadfa (gen-iadfa-from-file "../../data/com.zone.sorted.small"))
(fsa (iadfa-fsa iadfa)))
(with-open-file (str "output.txt" :direction :output :if-exists :supersede)
(dolist (word (extract-words fsa))
(format str "~A~%" word)))))

;(detect-problems-from-file "../../data/com.zone.sorted.small")
(iadfa-run)
(print-stats iadfa)))
;(with-open-file (str "output.txt" :direction :output :if-exists :supersede)
;(dolist (word (extract-words fsa))
;(format str "~A~%" word)))))



;(do-symbols (s (find-package :com.rrette.finenight.iadfa))
;(sb-ext:save-lisp-and-die "iadfa-run" :executable t :toplevel #'iadfa-run)


10 changes: 8 additions & 2 deletions finenight/lisp/iadfa.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,6 @@
(nb-per-hours 0)
(nb-hours-for-all 0))
(for-each-line-in-file (line file)
(format t "~,2F w/h ~,2F Hours ~A ~A ~%" nb-per-hours nb-hours-for-all index line)
(handle-word iadfa (concatenate 'list line))
(when (member index dump)
(graphviz-export-to-file (make-fsa-builder-from-fsa (iadfa-fsa iadfa)) (concatenate 'string "output/iadfa" (format nil "~A" index) ".dot"))
Expand All @@ -284,7 +283,8 @@
internal-time-units-per-second)) 60 60)))
(setf nb-hours-for-all (float (/ (* 65000 (/ (- current-time last-time)
internal-time-units-per-second)) 60 60)))
(setf last-time current-time)))
(setf last-time current-time)
(format t "~2,12$ w/h ~2,2$ Hours ~A ~A ~%" nb-per-hours nb-hours-for-all index line)))
iadfa)
iadfa))

Expand Down Expand Up @@ -384,6 +384,12 @@
words-to-be-checked))


(defun print-stats (iadfa)
(format t
"ancestrors length: ~A~%parent-arities length: ~A~%"
(length (iadfa-ancestrors iadfa))
(length (iadfa-parent-arities iadfa))))




Expand Down
7 changes: 4 additions & 3 deletions finenight/lisp/package.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,12 @@
:build-iadfa
:debug-gen-iadfa
:debug-gen-iadfa-from-file
:detect-problems-from-file
:gen-iadfa-from-file
:iadfa-fsa
:iadfa-state-ancestrors
:make-fsa-builder-from-fsa
:nadd-edge
:transition
:detect-problems-from-file
:test-equivalence))
:print-stats
:test-equivalence
:transition))

0 comments on commit f696b1a

Please sign in to comment.