0

I'm writing up a semantic fcfg file of my own and I have this grammar rule:

NP -> DT NNP NNP NNP

I wanted to write this particular rule with semantic extenstion so something like this:

NP[NUM=?n,SEM = <?det(?nnp?nnp?nnp)>] -> DT[NUM=?n,SEM=?det] NNP[NUM=?n,SEM=?nnp] NNP[NUM=?n,SEM=?nnp] NNP[NUM=?n,SEM=?nnp]

I tried parsing this rule with this sentence:

The(det) Orlando(NNP) Magic(NNP) City(NNP)

It doesnt work?

  • Break down your grammar to the simplest form (NP -> DT NNP) and the add complexity (feature structure) one rule at a time. – alvas Jan 27 '18 at 00:37
  • @alvas can you please give an example? – Quentin Hyatt Jan 28 '18 at 14:38
  • Take a look at how a sort of complex grammar is broken down and debugged step-by-step https://stackoverflow.com/questions/48195584/nltk-fcfg-grammer-parser-out-of-index/48218610#48218610 . Put some more effort into trying and update the questions how you had tried to debug first. Then we can help you better. I believe in you! – alvas Jan 29 '18 at 01:58
  • @alvas Thank you. Will try it out! – Quentin Hyatt Jan 29 '18 at 13:54
  • @QuentinHyatt I think the problem is DT: if your DT definition has no NUM feature, it wouldn't work. – peter.cyc Aug 26 '20 at 08:57

0 Answers0