Trying to get this working... harder than it should be!

This commit is contained in:
Simon Brooke 2020-04-27 09:40:58 +01:00
commit d924ef17c6
No known key found for this signature in database
GPG key ID: A7A4F18D1D4DF987
10 changed files with 615 additions and 0 deletions

7
test/wwui/core_test.clj Normal file
View file

@ -0,0 +1,7 @@
(ns wwui.core-test
(:require [clojure.test :refer :all]
[wwui.core :refer :all]))
(deftest a-test
(testing "FIXME, I fail."
(is (= 0 1))))

View file

@ -0,0 +1,31 @@
(ns wwui.propositions-test
(:require [clojure.test :refer :all]
[wwui.propositions :refer :all]))
(deftest a-test
(testing "FIXME, I fail."
(is (= 0 1))))
(deftest "RDP tests"
(testing "Simplest constructs"
(is (= (recursive-descent-parser [] grammar :noun) nil))
(is
(=
(recursive-descent-parser (pos-tag (tokenize "Brutus killed Caesar")) grammar :noun)
'(((["Brutus" "NNP"]) :noun) ["killed" "VBD"] ["Caesar" "NNP"])))
(is
(=
(recursive-descent-parser (pos-tag (tokenize "Brutus killed Caesar")) grammar :noun-phrase)
'((((["Brutus" "NNP"]) :noun) :nown-phrase) ["killed" "VBD"] ["Caesar" "NNP"])))
(is
(=
(recursive-descent-parser (pos-tag (tokenize "The Forum")) grammar :noun-phrase)
(((["The" "DT"]["Forum" "NNP"]) :noun-phrase))))
(is
(=
(recursive-descent-parser (pos-tag (tokenize "killed Caesar")) grammar :verb)
(((["killed" "VBN"]) :verb) ["Caesar" "NNP"])))
(is
(=
(recursive-descent-parser (pos-tag (tokenize "in the Forum")) grammar :locator)
(((["in" "IN"]["the" "DT"]["Forum" "NNP"]) :locator) )))))