get_synonyms method

get_synonyms

Gets the synonyms for the specified word.

The case of the letters of the word is not taken into account.

def get_synonyms(self, word):
    ...
Parameter Type Description
word str The word to suggest the synonyms.

Returns: list[str]: The synonyms for the specified word or an empty list if the SynonymDictionary object does not contain the specified word.

Raises Description
ValueError When word is None.

Example

words = synonyms.get_synonyms("Make")
print("Synonyms for 'make':")
for w in words:
    print(w)

Aliases

These names call get_synonyms too, limited to the overloads listed.

Alias Accepts
get_synonyms_file get_synonyms_file(word)
get_synonyms_string get_synonyms_string(word)

See Also