Advertisement
logicmoo

Untitled

Sep 26th, 2019
1,122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 2.01 KB | None | 0 0
  1. CYC(34): (charniak-parse "The cat sat on the mat.")
  2. ((:S1 (:S (:NP (:DT "The") (:NN "cat")) (:VP (:VBD "sat") (:PP # #)) (:\. "."))))
  3. 156
  4. CYC(35):
  5.  
  6. 2. OO oriented
  7.  
  8. You can create a parser object and call its 'parse method,
  9. which returns a parse-tree object that has many methods which
  10. I won't describe here:
  11.  
  12. CYC(38): (csetq parser (new-charniak-parser))
  13. #<CHARNIAK-PARSER (Error handling: :THROW) @ #x942761fa>
  14. CYC(39): (fim parser 'parse "The cat sat on the mat.")
  15. #<P(S):
  16.    #<P(NP):
  17.       #<W(DT): The>
  18.       #<W(NN): cat>
  19.    >
  20.    #<P(VP):
  21.       #<W(VBD): sat>
  22.       #<P(PP):
  23.          #<W(IN): on>
  24.          #<P(NP):
  25.             #<W(DT): the>
  26.             #<W(NN): mat>
  27.          >
  28.       >
  29.    >
  30.    #<W(.): .>
  31. >
  32. CYC(40):
  33.  
  34. 3. Semantics
  35.  
  36. To obtain actual CycL, use the cyclify function:
  37. CYC(43): (princ (cyclify "Daniel kissed Henrietta."))
  38. ((#$thereExists ?KISSED1245
  39.   (#$thereExists ?DANIEL1248
  40.    (#$thereExists ?HENRIETTA1249
  41.     (#$and (#$isa ?HENRIETTA1249 #$FemaleHuman) (#$givenNames ?HENRIETTA1249 Henrietta)
  42.      (#$isa ?DANIEL1248 #$MaleHuman) (#$givenNames ?DANIEL1248 Daniel)
  43.      (#$isa ?KISSED1245 #$Kissing) (#$performedBy ?KISSED1245 ?DANIEL1248)
  44.      (#$objectActedOn ?KISSED1245 ?HENRIETTA1249))))))
  45. ((#$thereExists ?KISSED1245
  46.   (#$thereExists ?DANIEL1248 (#$thereExists ?HENRIETTA1249 (#$and # # # # # # #)))))
  47. CYC(44):
  48.  
  49. wff-checking is on by default, but can be turned off (which doesn't make any difference
  50. here):
  51.  
  52. CYC(44): (princ (cyclify "Daniel kissed Henrietta." '(:wff-check? nil)))
  53. ((#$thereExists ?KISSED1251
  54.   (#$thereExists ?DANIEL1254
  55.    (#$thereExists ?HENRIETTA1255
  56.     (#$and (#$isa ?HENRIETTA1255 #$FemaleHuman) (#$givenNames ?HENRIETTA1255 Henrietta)
  57.      (#$isa ?DANIEL1254 #$MaleHuman) (#$givenNames ?DANIEL1254 Daniel)
  58.      (#$isa ?KISSED1251 #$Kissing) (#$performedBy ?KISSED1251 ?DANIEL1254)
  59.      (#$objectActedOn ?KISSED1251 ?HENRIETTA1255))))))
  60. ((#$thereExists ?KISSED1251
  61.   (#$thereExists ?DANIEL1254 (#$thereExists ?HENRIETTA1255 (#$and # # # # # # #)))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement