Advertisement
Gronos02

Untitled

Oct 16th, 2021
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -- coding: utf-8 --
  3. from linkgrammar import Sentence, ParseOptions, Dictionary, version
  4. print('Link Grammar Version:', version)
  5.  
  6. for sentence in ['This is a valid sample sentence.', 'I Can Has Cheezburger?']:
  7. sent = Sentence(sentence, Dictionary(), ParseOptions())
  8. linkages = sent.parse()
  9. if len(linkages) > 0:
  10. print('Valid:', sentence)
  11. else:
  12. print('Invalid:', sentence)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement