iit-cs585 / assignments

Assignments for IIT CS585
3 stars 7 forks source link

test_is_pos() #8

Closed nishug001 closed 7 years ago

nishug001 commented 7 years ago

rules = [('S', ['NP', 'VP']), ('NP', ['ProperNoun']), ('ProperNoun', ['John', 'Mary']), ('VP', ['V', 'ProperNoun']), ('V', ['likes', 'hates'])]

Should is_pos(('ProperNoun', ['XYZ',]), rules) return True or False as their is no production which leads for 'XYZ' ?

nik-birur-472 commented 7 years ago

Returns True as 'XYZ' doesn't appear as a LHS symbol in other rules.

aronwc commented 7 years ago

Yes.

On Wed, Jan 25, 2017 at 9:28 PM, Nikhil Birur notifications@github.com wrote:

Returns True as 'XYZ' doesn't appear as a LHS symbol in other rules.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/iit-cs585/assignments/issues/8#issuecomment-275300173, or mute the thread https://github.com/notifications/unsubscribe-auth/ADv-heUIwI_6jpwImO4dqpUnD9BoZdE9ks5rWBLWgaJpZM4LuOqT .

nishug001 commented 7 years ago

Thank you.