Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def rule(self, left, right):
- self.dictionary[left]=right
- print(self.dictionary)
- G.rule('Noun', ('cat',)) # 01
- G.rule('Noun', ('boy',)) # 02
- G.rule('Noun', ('dog',)) # 03
- G.rule('Noun', ('girl',)) # 04
- G.rule('Verb', ('bit',)) # 05
- G.rule('Verb', ('chased',)) # 06
- G.rule('Verb', ('kissed',)) # 07
- G.rule('Phrase', ('the', 'Noun', 'Verb', 'the', 'Noun')) # 08
- G.rule('Story', ('Phrase',)) # 09
- G.rule('Story', ('Phrase', 'and', 'Story')) # 10
- G.rule('Start', ('Story', '.')) # 11
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement