SynonymDictionary
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
Methods
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. |
getCount()
public abstract int getCount()
Gets the number of words contained in this SynonymDictionary .
Returns: int - The number of words contained in this SynonymDictionary .
addRange(Iterable<String[]> synonyms)
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. |
addRange(String[][] synonyms)
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. |
clear()
public abstract void clear()
Removes all words from this SynonymDictionary object.
getSynonyms(String word)
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.
getSynonymGroups(String 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.
getAllSynonymGroups()
public abstract String[][] getAllSynonymGroups()
Gets all groups of synonyms contained in this dictionary.
Returns: java.lang.String[][] - All groups of synonyms.
iterator()
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.