Advertisement
Guest User

Untitled

a guest
Feb 25th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. def rule(self, left, right):
  2. self.dictionary[left]=right
  3. print(self.dictionary)
  4. G.rule('Noun', ('cat',)) # 01
  5. G.rule('Noun', ('boy',)) # 02
  6. G.rule('Noun', ('dog',)) # 03
  7. G.rule('Noun', ('girl',)) # 04
  8. G.rule('Verb', ('bit',)) # 05
  9. G.rule('Verb', ('chased',)) # 06
  10. G.rule('Verb', ('kissed',)) # 07
  11. G.rule('Phrase', ('the', 'Noun', 'Verb', 'the', 'Noun')) # 08
  12. G.rule('Story', ('Phrase',)) # 09
  13. G.rule('Story', ('Phrase', 'and', 'Story')) # 10
  14. G.rule('Start', ('Story', '.')) # 11
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement