Example usage for com.liferay.portal.kernel.jazzy InvalidWord getSuggestions

List of usage examples for com.liferay.portal.kernel.jazzy InvalidWord getSuggestions

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.jazzy InvalidWord getSuggestions.

Prototype

public List<String> getSuggestions() 

Source Link

Usage

From source file:com.liferay.words.service.impl.WordsServiceImpl.java

License:Open Source License

@Override
public List<String> getSuggestions(String word) throws Exception {
    List<InvalidWord> invalidWords = WordsUtil.checkSpelling(word);

    if (invalidWords.isEmpty()) {
        return Collections.emptyList();
    }// w w w.  ja va 2s.  co m

    InvalidWord invalidWord = invalidWords.get(0);

    return invalidWord.getSuggestions();
}