Skip to content

Commit

Permalink
whitespace cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dakrone committed May 19, 2012
1 parent 16958cc commit 1bdb8b4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
6 changes: 3 additions & 3 deletions test/opennlp/test/nlp.clj
Expand Up @@ -71,7 +71,8 @@
(is (thrown? java.lang.AssertionError (name-find "asdf")))) (is (thrown? java.lang.AssertionError (name-find "asdf"))))


(deftest no-model-file-test (deftest no-model-file-test
(is (thrown? FileNotFoundException (make-sentence-detector "nonexistantfile"))) (is (thrown? FileNotFoundException
(make-sentence-detector "nonexistantfile")))
(is (thrown? FileNotFoundException (make-tokenizer "nonexistantfile"))) (is (thrown? FileNotFoundException (make-tokenizer "nonexistantfile")))
(is (thrown? FileNotFoundException (make-pos-tagger "nonexistantfile"))) (is (thrown? FileNotFoundException (make-pos-tagger "nonexistantfile")))
(is (thrown? FileNotFoundException (make-name-finder "nonexistantfile")))) (is (thrown? FileNotFoundException (make-name-finder "nonexistantfile"))))
Expand All @@ -83,5 +84,4 @@
(is (= (get (parse-categories outcomes-string outcomes) "CAT1")) 0.123456) (is (= (get (parse-categories outcomes-string outcomes) "CAT1")) 0.123456)
(is (= (get (parse-categories outcomes-string outcomes) "CAT2")) 0.234567) (is (= (get (parse-categories outcomes-string outcomes) "CAT2")) 0.234567)
(is (= (get (parse-categories outcomes-string outcomes) "CAT3")) 0.345678) (is (= (get (parse-categories outcomes-string outcomes) "CAT3")) 0.345678)
(is (= (get (parse-categories outcomes-string outcomes) "CAT4")) 0.456789) (is (= (get (parse-categories outcomes-string outcomes) "CAT4")) 0.456789)))
))
18 changes: 10 additions & 8 deletions test/opennlp/test/tools/train.clj
Expand Up @@ -87,17 +87,19 @@
"The third verse of the song was quite upbeat.")] "The third verse of the song was quite upbeat.")]
(is (= (:best-category test-cat) "Happy")) (is (= (:best-category test-cat) "Happy"))
(is (= (count (:probabilities (meta test-cat))) 2))) (is (= (count (:probabilities (meta test-cat))) 2)))

(let [test-cat (get-category (let [test-cat (get-category
"There was a sense of foreboding at the outset.")] "There was a sense of foreboding at the outset.")]
(is (= (:best-category test-cat) "Unhappy")) (is (= (:best-category test-cat) "Unhappy"))
(is (= (count (:probabilities (meta test-cat))) 2))) (is (= (count (:probabilities (meta test-cat))) 2)))
(is (= (:best-category (get-category (is (= (:best-category
"The sun was shining, smiles everywhere.")) (get-category "The sun was shining, smiles everywhere."))
"Happy")) "Happy"))
(is (= (:best-category (get-category (is (= (:best-category
"The confused prisoner could not figure out which way to go.")) (get-category (str "The confused prisoner could not figure "
"out which way to go.")))
"Unhappy")) "Unhappy"))
(is (= (:best-category (get-category (is (= (:best-category
"The frowning man chastized his son for not divulging the truth.")) (get-category (str "The frowning man chastized his son for "
"not divulging the truth.")))
"Unhappy")))) "Unhappy"))))

0 comments on commit 1bdb8b4

Please sign in to comment.