
morfologik.stemming.PolishStemmer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of morfologik-stemming Show documentation
Show all versions of morfologik-stemming Show documentation
Morfologik provides high quality lemmatisation for the Polish language,
along with tools for building and using byte-based finite state automata.
package morfologik.stemming;
import java.util.Iterator;
import java.util.List;
/**
* A dictionary-based stemmer for the Polish language. This stemmer requires an
* FSA-compiled dictionary to be present in classpath resources.
*
* Objects of this class are not thread safe.
*
* @see morfologik.stemming.DictionaryLookup
*/
public final class PolishStemmer implements IStemmer, Iterable {
/**
* Dictionary lookup delegate.
*/
private final DictionaryLookup delegate;
/**
* This constructor is initialized with a built-in dictionary or fails with
* a runtime exception if the dictionary is not available.
*/
public PolishStemmer() {
final String languageCode = "pl";
this.delegate = new DictionaryLookup(Dictionary.getForLanguage(languageCode));
}
/**
* {@inheritDoc}
*/
public List lookup(CharSequence word) {
return delegate.lookup(word);
}
/**
* Iterates over all dictionary forms stored in this stemmer.
*/
public Iterator iterator() {
return delegate.iterator();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy