Created
September 9, 2022 16:35
-
-
Save alexpdp7/f031e1c4d9908d6d901e9938658c4f8d to your computer and use it in GitHub Desktop.
Scryer parsing experiments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
?- [user]. | |
sentence(s(NP,VP)) --> noun_phrase(NP), verb_phrase(VP). | |
noun_phrase(np(D,N)) --> det(D), noun(N). | |
verb_phrase(vp(V,NP)) --> verb(V), noun_phrase(NP). | |
det(d("the")) --> "the". | |
det(d("a")) --> "a". | |
noun(n("bat")) --> "bat". | |
noun(n("cat")) --> "cat". | |
verb(v("eats")) --> "eats". | |
^D | |
?- sentence(Parse_tree, "thebateatsacat", []). | |
Parse_tree = s(np(d("the"),n("bat")),vp(v("eats"),np(d("a"),n("cat")))) | |
; false. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment