Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -- coding: utf-8 --
- from linkgrammar import Sentence, ParseOptions, Dictionary, version
- print('Link Grammar Version:', version)
- for sentence in ['This is a valid sample sentence.', 'I Can Has Cheezburger?']:
- sent = Sentence(sentence, Dictionary(), ParseOptions())
- linkages = sent.parse()
- if len(linkages) > 0:
- print('Valid:', sentence)
- else:
- print('Invalid:', sentence)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement