Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nltk
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
nltk
Commits
5de11e9d
Commit
5de11e9d
authored
Jul 31, 2012
by
Ewan Klein
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfixes in grammar rules, supplied by Robin Cooper
parent
512cae5b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
13 deletions
+20
-13
examples/grammars/book_grammars/storage.fcfg
+9
-3
examples/grammars/sample_grammars/hole.fcfg
+11
-10
No files found.
examples/grammars/book_grammars/storage.fcfg
View file @
5de11e9d
...
...
@@ -14,7 +14,8 @@
## accomplished by using the InstantiateVarsChart class when parsing.
##
## Author: Edward Loper <edloper@gradient.cis.upenn.edu>,
## Ewan Klein <ewan@inf.ed.ac.uk>
## Ewan Klein <ewan@inf.ed.ac.uk>
## Robin Cooper <robin.cooper@ling.gu.se>
## URL: <http://nltk.sourceforge.net>
## For license information, see LICENSE.TXT
...
...
@@ -24,7 +25,7 @@ S[SEM=[CORE=<?vp(?subj)>, STORE=(?b1+?b2)]] -> NP[SEM=[CORE=?subj, STORE=?b1]] V
VP[SEM=?s] -> IV[SEM=?s]
VP[SEM=[CORE=<?v(?obj)>, STORE=(?b1+?b2)]] -> TV[SEM=[CORE=?v, STORE=?b1]] NP[SEM=[CORE=?obj, STORE=?b2]]
VP[SEM=[CORE=<?v(?
obj)>, STORE=(?b1+?b2+?b3)]] -> DTV[SEM=[CORE=?v, STORE=?b1]] NP[SEM=[CORE=?obj, STORE=?b2]] PP[+TO, SEM=[CORE=?pp, STORE=?b3]]
VP[SEM=[CORE=<?v(?
pp)(?obj)>, STORE=(?b1+?b2+?b3)]] -> DTV[SEM=[CORE=?v, STORE=?b1]] NP[SEM=[CORE=?obj, STORE=?b2]] PP[+TO, SEM=[CORE=?pp, STORE=?b3]]
NP[SEM=[CORE=<@x>, STORE=((<bo(?det(?n),@x)>)+?b1+?b2)]] -> Det[SEM=[CORE=?det, STORE=?b1]] N[SEM=[CORE=?n, STORE=?b2]]
...
...
@@ -38,11 +39,16 @@ N[SEM=[CORE=<dog>, STORE=(/)]] -> 'dog'
N[SEM=[CORE=<bone>, STORE=(/)]] -> 'bone'
N[SEM=[CORE=<girl>, STORE=(/)]] -> 'girl'
N[SEM=[CORE=<man>, STORE=(/)]] -> 'man'
IV[SEM=[CORE=<\x.smile(x)>, STORE=(/)]] -> 'smiles'
IV[SEM=[CORE=<\x.walk(x)>, STORE=(/)]] -> 'walks'
TV[SEM=[CORE=<\y x.feed(x,y)>, STORE=(/)]] -> 'feeds'
TV[SEM=[CORE=<\y x.chase(x,y)>, STORE=(/)]] -> 'chases'
DTV[SEM=[CORE=<\y x.give(x,y, z)>, STORE=(/)]] -> 'gives'
DTV[SEM=[CORE=<\z y x.give(x,y,z)>, STORE=(/)]] -> 'gives'
NP[SEM=[CORE=<@x>, STORE=(<bo(\P.P(angus),@x)>)]] -> 'Angus'
NP[SEM=[CORE=<@x>, STORE=(<bo(\P.P(cyril),@x)>)]] -> 'Cyril'
P[+TO] -> 'to'
examples/grammars/sample_grammars/hole.fcfg
View file @
5de11e9d
...
...
@@ -4,19 +4,20 @@
## module for Hole Semantics (see Blackburn and Bos).
##
## Author: Dan Garrette <DHGarrette@gmail.com>
## Robin Cooper <robin.cooper@ling.gu.se>
## URL: <http://www.nltk.org>
## For license information, see LICENSE.TXT
% start S
S[
sem = <?subj(?vp)>] -> NP[sem=?subj] VP[sem
=?vp]
VP[
sem=?v] -> IV[sem
=?v]
VP[
num=?n,sem=<?v(?obj)>] -> TV[num=?n,sem=?v] NP[sem
=?obj]
NP[
sem=<?det(?n)>] -> Det[sem=?det] N[sem
=?n]
S[
SEM=<?subj(?vp)>] -> NP[SEM=?subj] VP[SEM
=?vp]
VP[
SEM=?v] -> IV[SEM
=?v]
VP[
NUM=?n,SEM=<?v(?obj)>] -> TV[NUM=?n,SEM=?v] NP[SEM
=?obj]
NP[
SEM=<?det(?n)>] -> Det[SEM=?det] N[SEM
=?n]
Det[
sem
=<\P Q h l.exists h1 l1 l2 l3 x.(ALL(l2,x,l3) & IMP(l3,l1,h1) & LEQ(l,h1) & LEQ(l2,h) & P(x)(h)(l1) & Q(x)(h)(l) & HOLE(h) & HOLE(h1) & LABEL(l) & LABEL(l1) & LABEL(l2) & LABEL(l3))>] -> 'every'
Det[
sem
=<\P Q h l.exists h1 l1 l2 l3 x.(EXISTS(l2,x,l3) & AND(l3,l1,h1) & LEQ(l,h1) & LEQ(l2,h) & P(x)(h)(l1) & Q(x)(h)(l) & HOLE(h) & HOLE(h1) & LABEL(l) & LABEL(l1) & LABEL(l2) & LABEL(l3))>] -> 'a'
N[
sem
=<\x h l.(PRED(l,girl,x) & LEQ(l,h) & HOLE(h) & LABEL(l))>] -> 'girl'
N[
sem
=<\x h l.(PRED(l,dog,x) & LEQ(l,h) & HOLE(h) & LABEL(l))>] -> 'dog'
IV[
sem
=<\x h l.(PRED(l,bark,x) & LEQ(l,h) & HOLE(h) & LABEL(l))>] -> 'barks'
TV[
sem=<\P x.P(\y h l.(PRED(l,chase,y,x
) & LEQ(l,h) & HOLE(h) & LABEL(l)))>] -> 'chases'
Det[
SEM
=<\P Q h l.exists h1 l1 l2 l3 x.(ALL(l2,x,l3) & IMP(l3,l1,h1) & LEQ(l,h1) & LEQ(l2,h) & P(x)(h)(l1) & Q(x)(h)(l) & HOLE(h) & HOLE(h1) & LABEL(l) & LABEL(l1) & LABEL(l2) & LABEL(l3))>] -> 'every'
Det[
SEM
=<\P Q h l.exists h1 l1 l2 l3 x.(EXISTS(l2,x,l3) & AND(l3,l1,h1) & LEQ(l,h1) & LEQ(l2,h) & P(x)(h)(l1) & Q(x)(h)(l) & HOLE(h) & HOLE(h1) & LABEL(l) & LABEL(l1) & LABEL(l2) & LABEL(l3))>] -> 'a'
N[
SEM
=<\x h l.(PRED(l,girl,x) & LEQ(l,h) & HOLE(h) & LABEL(l))>] -> 'girl'
N[
SEM
=<\x h l.(PRED(l,dog,x) & LEQ(l,h) & HOLE(h) & LABEL(l))>] -> 'dog'
IV[
SEM
=<\x h l.(PRED(l,bark,x) & LEQ(l,h) & HOLE(h) & LABEL(l))>] -> 'barks'
TV[
SEM=<\P x.P(\y h l.(PRED(l,chase,x,y
) & LEQ(l,h) & HOLE(h) & LABEL(l)))>] -> 'chases'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment