Esempio n. 1
0
File: lin.py Progetto: sp00/nltk
def demo():
    from nltk.corpus import lin_thesaurus as thes

    word1 = "business"
    word2 = "enterprise"
    print "Getting synonyms for " + word1
    print thes.synonyms(word1)

    print "Getting scored synonyms for " + word1
    print thes.synonyms(word1)

    print "Getting synonyms from simN.lsp (noun subsection) for " + word1
    print thes.synonyms(word1, fileid="simN.lsp")

    print "Getting synonyms from simN.lsp (noun subsection) for " + word1
    print thes.synonyms(word1, fileid="simN.lsp")

    print "Similarity score for %s and %s:" % (word1, word2)
    print thes.similarity(word1, word2)
Esempio n. 2
0
def demo():
    from nltk.corpus import lin_thesaurus as thes

    word1 = "business"
    word2 = "enterprise"
    print "Getting synonyms for " + word1
    print thes.synonyms(word1)

    print "Getting scored synonyms for " + word1
    print thes.synonyms(word1)

    print "Getting synonyms from simN.lsp (noun subsection) for " + word1
    print thes.synonyms(word1, fileid="simN.lsp")

    print "Getting synonyms from simN.lsp (noun subsection) for " + word1
    print thes.synonyms(word1, fileid="simN.lsp")

    print "Similarity score for %s and %s:" % (word1, word2)
    print thes.similarity(word1, word2)
Esempio n. 3
0
def demo():
    from nltk.corpus import lin_thesaurus as thes

    word1 = "business"
    word2 = "enterprise"
    print("Getting synonyms for " + word1)
    print(thes.synonyms(word1))

    print("Getting scored synonyms for " + word1)
    print(thes.scored_synonyms(word1))

    print("Getting synonyms from simN.lsp (noun subsection) for " + word1)
    print(thes.synonyms(word1, fileid="simN.lsp"))

    print("Getting synonyms from simN.lsp (noun subsection) for " + word1)
    print(thes.synonyms(word1, fileid="simN.lsp"))

    print(f"Similarity score for {word1} and {word2}:")
    print(thes.similarity(word1, word2))