M
M
Marina18022021-11-08 12:19:59
Python
Marina1802, 2021-11-08 12:19:59

How to get 3 words from the file that are most similar to the one the user enters?

How to get 3 words from the file that are most similar to the one the user enters? I tried to do something, but nothing worked

w = input('Please, enter your word:')
a = w
print(a)

from nltk.corpus import wordnet as wn
words = wordnet.words('1-1000.txt')
for synset in '1-1000.txt'(a, wn.NOUN):
    print(synset.name().lemma_names())

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
LXSTVAYNE, 2021-11-08
@lxstvayne

You need a fuzzy comparison algorithm, you can try the fuzzywuzzy library.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question