Created
September 4, 2015 04:19
-
-
Save letuananh/5eafe0e9aaba465922f3 to your computer and use it in GitHub Desktop.
Count lemmas in WordNet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import nltk | |
| from nltk.corpus import wordnet as wn | |
| DOG = wn.synsets("dog")[0] | |
| print(DOG) | |
| eDOG = DOG.lemmas(lang='eng')[0] | |
| print(eDOG) | |
| print(eDOG.count()) | |
| fDOG = DOG.lemmas(lang='fra')[0] | |
| print(fDOG) | |
| print(fDOG.count()) | |
| def main(): | |
| pass | |
| if __name__ == "__main__": | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment