Skip to content

Instantly share code, notes, and snippets.

@letuananh
Created September 4, 2015 04:19
Show Gist options
  • Save letuananh/5eafe0e9aaba465922f3 to your computer and use it in GitHub Desktop.
Save letuananh/5eafe0e9aaba465922f3 to your computer and use it in GitHub Desktop.

Revisions

  1. letuananh created this gist Sep 4, 2015.
    23 changes: 23 additions & 0 deletions wordnet_count.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    #!/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()