get_synonym_groups method

get_synonym_groups

Gets all groups of synonyms to which the specified word belongs.

The case of the letters of the word is not taken into account: the groups contain the word as the dictionary keeps it, in the lower case.

def get_synonym_groups(self, word):
    ...
Parameter Type Description
word str The word for getting groups of synonyms.

Returns: list[list[str]]: All groups of synonyms to which the specified word belongs.

Raises Description
ValueError If word is None.

Example

from groupdocs.search import Index

index = Index("./MyIndex")
synonyms = index.dictionaries.synonym_dictionary
groups = synonyms.get_synonym_groups("make")
print("Synonym groups for 'make':")
for group in groups:
    print(" ".join(group))

# Optionally clear the dictionary
if synonyms.count > 0:
    synonyms.clear()

Aliases

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

Alias Accepts
get_synonym_groups_file get_synonym_groups_file(word)
get_synonym_groups_string get_synonym_groups_string(word)

See Also