Coverage report: /home/ellis/comp/core/lib/nlp/tests.lisp

KindCoveredAll%
expression012 0.0
branch00nil
Key
Not instrumented
Conditionalized out
Executed
Not executed
 
Both branches taken
One branch taken
Neither branch taken
1
 (defpackage :nlp/tests
2
   (:use :cl :std :rt :nlp))
3
 
4
 (in-package :nlp/tests)
5
 
6
 (defsuite :nlp)
7
 (in-suite :nlp)
8
 
9
 (defvar *test-docs* (make-instance 'document-collection))
10
 
11
 (deftest tokenize ()
12
   (is (= 3 (length (word-tokenize "foo bar baz"))))
13
   (is (= 2 (length (sentence-tokenize "This is the first second. Now the second")))))
14
 
15
 (deftest sections ()
16
   (is (typep (extract-sections "Testing 1 2 3") 'document-collection)))
17
 
18
 (deftest porter-stem ()
19
   (is (string= (stem "hacking") "hack")))
20
 
21
 (deftest docs ()
22
   (let ((doc (make-instance 'document :string-contents "test test test")))
23
     (is (= 3 (nlp/doc:term-count
24
               doc "test")))
25
     (is (= 1.0 (nlp/doc:term-frequency
26
                 doc "test")))))
27
 
28
 (deftest textrank ()
29
   (istype 'list 
30
           (summarize-text 
31
            "This is a test which will be summarized by the 'SUMMARIZE-TEXT' function. Yada yada. Test 1 2 3.")))
32
 
33
 (deftest dbscan ()
34
   (dbscan (extract-sections "This is a test which will be summarized by the 'SUMMARIZE-TEXT' function. Yada yada. Test 1 2 3.")))