SynonymDictionary
Leave feedback
On this page
All Implemented Interfaces: com.groupdocs.search.dictionaries.DictionaryBase, java.lang.Iterable
public interface SynonymDictionary extends DictionaryBase, Iterable<String>
Defines interface of a dictionary of synonyms.
Learn more
| Method | Description |
|---|---|
| getCount() | Gets the number of words contained in this SynonymDictionary . |
| addRange(Iterable<String[]> synonyms) | Adds the specified collection of synonym groups to this instance of the SynonymDictionary . |
| addRange(String[][] synonyms) | Adds the specified collection of synonym groups to this instance of the SynonymDictionary . |
| clear() | Removes all words from this SynonymDictionary object. |
| getSynonyms(String word) | Gets the synonyms for the specified word. |
| getSynonymGroups(String word) | Gets all groups of synonyms to which the specified word belongs. |
| getAllSynonymGroups() | Gets all groups of synonyms contained in this dictionary. |
| iterator() | Returns an iterator that iterates through the collection. |
public abstract int getCount()
Gets the number of words contained in this SynonymDictionary .
Returns: int - The number of words contained in this SynonymDictionary .
public abstract void addRange(Iterable<String[]> synonyms)
Adds the specified collection of synonym groups to this instance of the SynonymDictionary .
Parameters:
| Parameter | Type | Description |
|---|---|---|
| synonyms | java.lang.Iterable<java.lang.String[]> | The collection of synonym groups to add to the dictionary. |
public abstract void addRange(String[][] synonyms)
Adds the specified collection of synonym groups to this instance of the SynonymDictionary .
Parameters:
| Parameter | Type | Description |
|---|---|---|
| synonyms | java.lang.String[][] | The collection of synonym groups to add to the dictionary. |
public abstract void clear()
Removes all words from this SynonymDictionary object.
public abstract String[] getSynonyms(String word)
Gets the synonyms for the specified word. The resulting array does not contain the original word.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| word | java.lang.String | The word to suggest the synonyms. |
Returns: java.lang.String[] - The synonyms for the specified word or empty array if the SynonymDictionary object does not contain the specified word.
public abstract String[][] getSynonymGroups(String word)
Gets all groups of synonyms to which the specified word belongs.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| word | java.lang.String | The word for getting groups of synonyms. |
Returns: java.lang.String[][] - All groups of synonyms to which the specified word belongs.
public abstract String[][] getAllSynonymGroups()
Gets all groups of synonyms contained in this dictionary.
Returns: java.lang.String[][] - All groups of synonyms.
public abstract Iterator<String> iterator()
Returns an iterator that iterates through the collection.
Returns: java.util.Iterator<java.lang.String> - An iterator that can be used to iterate through the collection.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.