Hatena::Groupcadr

bulbのLisp日記 RSSフィード

2008-01-08

[][]2.5 22:46 2.5 - bulbのLisp日記 を含むブックマーク はてなブックマーク - 2.5 - bulbのLisp日記

grammar を増やしますよ。

(defparameter *bigger-grammar*
  '((sentence -> (noun-phrase verb-phrase))
    (noun-phrase -> (Article Adj* Noun PP*) (Name) (Pronoun))
    (verb-phrase -> (Verb noun-phrase PP*))
    (PP* -> () (PP PP*))
    (Adj* -> () (Adj Adj*))
    (PP -> (Prep noun-phrase))
    (Prep -> to in by with on)
    (Adj -> big little bule green adiabatic)
    (Article -> the a)
    (Name -> Peter Paul Seibel Guy Steel)
    (Noun -> man ball woman table)
    (Verb -> hit took saw liked)
    (Pronoun -> he she it these those that)))

(setf *grammar* *bigger-grammar*)

#|
CL-USER> (generate 'sentence)
(THE ADIABATIC LITTLE GREEN WOMAN SAW THE MAN ON HE)
CL-USER> (generate 'sentence)
(THE MAN TO A GREEN TABLE WITH STEEL ON A LITTLE MAN TO THE TABLE BY SEIBEL IN
     THAT TOOK THE ADIABATIC LITTLE TABLE IN SHE WITH A BULE GREEN WOMAN TO GUY
     BY PAUL ON STEEL)
CL-USER> (generate 'sentence)
(PETER TOOK SHE)
|#


英文の結果がまだ変ですね。

でもこれがAIへの入り口?