Again test the positive and negative examples, and verify that all positive examples are accepted, and none of the negative examples are accepted. You may add more positive and negative examples (with words in the lexicon) to convince yourself that your grammar is satisfactory.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
NP
VP [SUBCAT=nil]
VP [SUBCAT= [HEAD=pp,TAIL=nil]]
ARG [CAT=pp]
he VP [SUBCAT=[HEAD=np,TAIL= [HEAD=pp,TAIL=nil]]] ARG [CAT=np]
PP
|
V [SUBCAT= [HEAD=np,TAIL=[HEAD=pp,TAIL=nil]]]
NP
gave
to his brother
the bike
Figure 1: Graphical representation of the parse of he gave the bike to his brother.
Note the
two applications of VP[SUBCAT=?rest] -> VP[SUBCAT=[HEAD=?arg,
TAIL=?rest]] ARG[CAT=?arg]. Also note the topmost VP has [SUBCAT=nil], which
is needed to apply the rule with left-hand side S.
How the rules for subcategorisation are applied is illustrated in Figure 1. In order to
handle the verbs in our example sentences, further rules for V and ARG are needed, but it
should be possible to reuse the rule VP[SUBCAT=?rest] -> VP[SUBCAT=[HEAD=?arg,
TAIL=?rest]] ARG[CAT=?arg] for several verbs, regardless of their subcategorisation
frames.
Step 4: final testing
Again test the positive and negative examples, and verify that all positive examples
are accepted, and none of the negative examples are accepted. You may add more
positive and negative examples (with words in the lexicon) to convince yourself that
your grammar is satisfactory.
Requirements
Submit a zipped file containing:
• P2. py (unmodified)
• P2.fcfg (extended by you)
• P2. pos (extended by you)
Transcribed Image Text:NP VP [SUBCAT=nil] VP [SUBCAT= [HEAD=pp,TAIL=nil]] ARG [CAT=pp] he VP [SUBCAT=[HEAD=np,TAIL= [HEAD=pp,TAIL=nil]]] ARG [CAT=np] PP | V [SUBCAT= [HEAD=np,TAIL=[HEAD=pp,TAIL=nil]]] NP gave to his brother the bike Figure 1: Graphical representation of the parse of he gave the bike to his brother. Note the two applications of VP[SUBCAT=?rest] -> VP[SUBCAT=[HEAD=?arg, TAIL=?rest]] ARG[CAT=?arg]. Also note the topmost VP has [SUBCAT=nil], which is needed to apply the rule with left-hand side S. How the rules for subcategorisation are applied is illustrated in Figure 1. In order to handle the verbs in our example sentences, further rules for V and ARG are needed, but it should be possible to reuse the rule VP[SUBCAT=?rest] -> VP[SUBCAT=[HEAD=?arg, TAIL=?rest]] ARG[CAT=?arg] for several verbs, regardless of their subcategorisation frames. Step 4: final testing Again test the positive and negative examples, and verify that all positive examples are accepted, and none of the negative examples are accepted. You may add more positive and negative examples (with words in the lexicon) to convince yourself that your grammar is satisfactory. Requirements Submit a zipped file containing: • P2. py (unmodified) • P2.fcfg (extended by you) • P2. pos (extended by you)
NP
VP [SUBCAT=nil]
VP [SUBCAT= [HEAD=pp,TAIL=nil]]
ARG [CAT=pp]
he VP [SUBCAT=[HEAD=np,TAIL= [HEAD=pp,TAIL=nil]]] ARG [CAT=np]
PP
|
V [SUBCAT= [HEAD=np,TAIL=[HEAD=pp,TAIL=nil]]]
NP
gave
to his brother
the bike
Figure 1: Graphical representation of the parse of he gave the bike to his brother.
Note the
two applications of VP[SUBCAT=?rest] -> VP[SUBCAT=[HEAD=?arg,
TAIL=?rest]] ARG[CAT=?arg]. Also note the topmost VP has [SUBCAT=nil], which
is needed to apply the rule with left-hand side S.
How the rules for subcategorisation are applied is illustrated in Figure 1. In order to
handle the verbs in our example sentences, further rules for V and ARG are needed, but it
should be possible to reuse the rule VP[SUBCAT=?rest] -> VP[SUBCAT=[HEAD=?arg,
TAIL=?rest]] ARG[CAT=?arg] for several verbs, regardless of their subcategorisation
frames.
Step 4: final testing
Again test the positive and negative examples, and verify that all positive examples
are accepted, and none of the negative examples are accepted. You may add more
positive and negative examples (with words in the lexicon) to convince yourself that
your grammar is satisfactory.
Requirements
Submit a zipped file containing:
• P2. py (unmodified)
• P2.fcfg (extended by you)
• P2. pos (extended by you)
Transcribed Image Text:NP VP [SUBCAT=nil] VP [SUBCAT= [HEAD=pp,TAIL=nil]] ARG [CAT=pp] he VP [SUBCAT=[HEAD=np,TAIL= [HEAD=pp,TAIL=nil]]] ARG [CAT=np] PP | V [SUBCAT= [HEAD=np,TAIL=[HEAD=pp,TAIL=nil]]] NP gave to his brother the bike Figure 1: Graphical representation of the parse of he gave the bike to his brother. Note the two applications of VP[SUBCAT=?rest] -> VP[SUBCAT=[HEAD=?arg, TAIL=?rest]] ARG[CAT=?arg]. Also note the topmost VP has [SUBCAT=nil], which is needed to apply the rule with left-hand side S. How the rules for subcategorisation are applied is illustrated in Figure 1. In order to handle the verbs in our example sentences, further rules for V and ARG are needed, but it should be possible to reuse the rule VP[SUBCAT=?rest] -> VP[SUBCAT=[HEAD=?arg, TAIL=?rest]] ARG[CAT=?arg] for several verbs, regardless of their subcategorisation frames. Step 4: final testing Again test the positive and negative examples, and verify that all positive examples are accepted, and none of the negative examples are accepted. You may add more positive and negative examples (with words in the lexicon) to convince yourself that your grammar is satisfactory. Requirements Submit a zipped file containing: • P2. py (unmodified) • P2.fcfg (extended by you) • P2. pos (extended by you)
Expert Solution
Step 1

P2.fcfg

 

S -> Sentence | WSentence | WQuestion

Sentence -> NP[ARG=?arg] VP[ARG=?arg,SUBCAT=nil]

WSentence -> WAdv Sentence Sentence

 

## the verb must be in the plural form

WQuestion -> WAdv AuxV[ARG=?arg] NP[ARG=?arg] VP[ARG=[NUM=pl,FORM=pres],SUBCAT=nil]

WQuestion -> WhPron AuxV[ARG=?arg] NP[ARG=?arg] VP[ARG=[NUM=pl,FORM=pres],SUBCAT=nil]

WQuestion -> PosWh AuxV[ARG=?arg] NP[ARG=?arg] VP[ARG=[NUM=pl,FORM=pres],SUBCAT=nil]

 

 

NP -> ADJ | NP Conj NP

NP[ARG=?arg] -> ProperNoun[ARG=?arg]

NP[ARG=?arg] -> Det[ARG=?arg] ADJ

NP[ARG=?arg] -> Det[ARG=?arg] Nominal[ARG=?arg]

Nominal[ARG=?arg] -> Nominal[ARG=?arg] Noun[ARG=?arg] | Noun[ARG=?arg]

NP[ARG=?arg] -> Nominal[ARG=?arg]

NP[ARG=?arg] -> NP[ARG=?arg] PP

 

ADJ -> Adj NP

PP -> Prep NP

 

ARGS[CAT=np] -> NP

ARGS[CAT=vp] -> VP

ARGS[CAT=pp] -> PP

ARGS[CAT=adj] -> Adj

ARGS[CAT=s] -> Sentence

 

VP[SUBCAT=?sub,ARG=?arg] -> V[SUBCAT=?sub,ARG=?arg]

VP[SUBCAT=?rest,ARG=?arg] -> VP[SUBCAT=nil,ARG=?arg] Conj VP[SUBCAT=nil,ARG=?arg]

VP[SUBCAT=nil,ARG=?arg] -> Adv VP[SUBCAT=?sub,ARG=?arg]

VP[SUBCAT=?rest,ARG=?arg] -> VP[SUBCAT=[HEAD=?cat,TAIL=?rest],ARG=?arg] ARGS[CAT=?cat]

VP[SUBCAT=?sub,ARG=?arg] -> GerundSent[SUBCAT=?sub,ARG=?arg]

VP[SUBCAT=?sub,ARG=?arg] -> ModalSent[SUBCAT=?sub,ARG=?arg]

 

GerundSent[SUBCAT=?sub,ARG=?arg] -> V[SUBCAT=?vbg,ARG=[FORM=gerundgsent,PER=?p,NUM=?n]]  VBG[cat=?vbg]

ModalSent[SUBCAT=?sub,ARG=?arg]  -> Modal V[SUBCAT=?sub,ARG=[FORM=?f,NUM=pl]] ARGS[CAT=np]

ModalSent[SUBCAT=?sub,ARG=?arg]  -> Modal VH[ARG=[FROM=modal,NUM=pl]] VPASTPART ARGS[CAT=np]

ModalSent[SUBCAT=?sub,ARG=?arg]  -> Modal NEG VH[ARG=[FROM=modal,NUM=pl]] VPASTPART ARGS[CAT=np]

 

 

V[SUBCAT=nil,ARG=[FORM=pres,PER=3,NUM=sg]] -> 'barks'|'giggles'

V[SUBCAT=nil,ARG=[FORM=pres,NUM=pl]] ->  'bark'|'serve'

V[SUBCAT=[HEAD=s,TAIL=nil],ARG=[FORM=pres,PER=3,NUM=sg]] -> 'thinks'

V[SUBCAT=[HEAD=np,TAIL=nil],ARG=[FORM=pres,PER=3,NUM=sg]] -> 'feeds' | 'eats' | 'drinks'|'wears'

 

#because we can have feed NP NP (feed gromit(np) cheese and bread(np -> np conj np)

V[SUBCAT=[HEAD=np, TAIL=[HEAD=np, TAIL=nil]],ARG=[FORM=pres,PER=3,NUM=sg]] -> 'feeds'|'serves'

 

#puts (np)the dish (pp) in the sink

V[SUBCAT=[HEAD=np,TAIL=[HEAD=pp,TAIL=nil]],ARG=[FORM=pres,PER=3,NUM=sg]] -> 'puts'

 

#NP HEAD BECAUSE -> THEY FEED/EAT __

V[SUBCAT=[HEAD=np,TAIL=nil],ARG=[FORM=pres,NUM=pl]] -> 'feed' | 'eat' | 'have'|'drink'|'wear'|'serve'|'put'

 

V[SUBCAT=nil,FORM=pres,NUM=pl] ->'have'

V[SUBCAT=[HEAD=np, TAIL=[HEAD=np, TAIL=nil]],ARG=[FORM=pres,NUM=pl]] -> 'feed'

V[SUBCAT=[HEAD=s,TAIL=nil],ARG=[FORM=pres,NUM=pl]] -> 'think'

V[SUBCAT=[HEAD=np],ARG=[FORM=pres,PER=3,NUM=sg]] -> 'likes'

 

#TO HANDLE PHRASES SUCH AS -> WHAT DO YOU THINK

V[SUBCAT=nil,ARG=[FROM=pres,NUM=pl]] -> 'think' | 'eat'|'drink'

 

V[SUBCAT=[HEAD=np,TAIL=nil],ARG=[FORM=past]] -> 'fed' | 'ate'|'served'

V[SUBCAT=[HEAD=np,TAIL=[HEAD=np, TAIL=nil]],ARG=[FORM=past]] -> 'feed'

 

##ate can be both transitive and intransitive (they ate (a chocolate))

V[SUBCAT=nil,ARG=[FORM=past]] -> 'barked' | 'ate'|'giggled'

 

 

V[SUBCAT=[HEAD=vbg,TAIL=nil],ARG=[FROM=gerundgsent,PER=3,NUM=sg]] -> 'likes'

 

VH[ARG=[FORM=modal,NUM=pl]] -> 'have'

VBG[CAT=vbg] -> 'eating' | 'feeding'|'drinking'

VPASTPART -> 'eaten' | 'seen'|'served'

AuxV[ARG=[FORM=pres,NUM=sg,PER=3]] -> 'does'

AuxV[ARG=[FORM=past]] -> 'did'|'do'

V ->  'think'|'put'

 

ProperNoun[ARG=[NUM=sg,PER=3]] -> 'Wallace' |  'Gromit'|'Bart'|'Homer'|'Lisa'

Noun[ARG=[NUM=sg]] -> 'cheese' | 'water' | 'kitchen' | 'dinner' | 'bread' | 'dog'|'shoes'|'salad'|'milk'|'lunch'

Noun[ARG=[NUM=pl]] -> 'dogs' |'sandwiches'

Det[ARG=[NUM=sg]] -> 'that' | 'a'

Det[ARG=[NUM=pl]] -> 'these' | 'those'

Det -> 'the' |'my'

Prep -> 'in' | 'after' | 'when'

Adv -> 'seldom' | 'often'|'never'

Conj -> 'and' | 'when'

Adj -> 'tasty' | 'soft'|'blue'|'green'|'healthy'

WAdv -> 'when' | 'where'

WhPron -> 'what'

PosWh -> 'whom'

Modal -> 'may'

NEG -> 'not'

steps

Step by step

Solved in 3 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY