;;; -*- Mode: Lisp; Syntax: Common-Lisp; -*- File: language/domains/prob-grammars.lisp

;;;; A Probabilistic Grammar in Chomsky Normal Form, and a Treebank Tree

(defparameter *e-prob-chomsky*
  (make-pcfg
   :rules '((S NP VP 1.0)
            (NP Article Noun 0.6) (NP Adjective Noun 0.4)
            (VP Verb NP 0.5) (VP Verb Adjective 0.5))
   :lexicon '((Article the 0.5) (Article a 0.25) (Article an 0.25)
              (Noun robot 0.4) (Noun sheep 0.4) (Noun fence 0.2)
              (Adjective good 0.5) (Adjective new 0.2) (Adjective sad 0.3)
              (Verb is 0.5) (Verb say 0.3) (Verb are 0.2)))
  "A small probabilistic grammar in Chomsky Normal Form for the CYK parser.")

(defparameter *sentence-tree*
  '(S (NP-2 "Her" "eyes")
      (VP "were"
          (VP "glazed"
              (NP "*-2")
              (SBAR-ADV "as" "if"
                        (S (NP "she")
                           (VP "did" "n't"
                               (VP (VP "hear" (NP "*-1"))
                                   "or"
                                   (VP (ADVP "even") "see" (NP "*-1"))
                                   (NP-1 "him")))))))
      ".")
  "The annotated tree of Figure 23.8, from the Penn Treebank.")
