Package org.basex.util.ft
Class Stemmer
java.lang.Object
org.basex.util.ft.FTIterator
org.basex.util.ft.Stemmer
- All Implemented Interfaces:
Comparable<org.basex.util.ft.LanguageImpl>,Iterator<FTSpan>
Implementation of common stemmer methods.
- Author:
- BaseX Team 2005-21, BSD License, Dimitar Popov
-
Method Summary
Modifier and TypeMethodDescriptionfinal intcompareTo(org.basex.util.ft.LanguageImpl o) final booleaninthashCode()final booleanhasNext()final Stemmerinit(byte[] txt) Initializes the iterator.final FTSpannext()final byte[]Returns the next token.protected abstract byteprec()Returns the precedence of the processor.protected abstract byte[]stem(byte[] word) Stems a word.static booleansupportFor(Language language) Checks if the language is supported by the available stemmers.booleanChecks if the specified language is supported.toString()Methods inherited from class org.basex.util.ft.FTIterator
removeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Method Details
-
supportFor
Checks if the language is supported by the available stemmers.- Parameters:
language- language to be found- Returns:
- result of check
-
stem
protected abstract byte[] stem(byte[] word) Stems a word.- Parameters:
word- input word to stem- Returns:
- the stem of the word
-
init
Description copied from class:FTIteratorInitializes the iterator.- Specified by:
initin classFTIterator- Parameters:
txt- text- Returns:
- self reference
-
hasNext
public final boolean hasNext() -
next
-
nextToken
public final byte[] nextToken()Description copied from class:FTIteratorReturns the next token. May be called as an alternative toIterator.next()to avoid the creation of newFTSpaninstances.- Specified by:
nextTokenin classFTIterator- Returns:
- token
-
toString
-
prec
protected abstract byte prec()Returns the precedence of the processor. If two language implementations support the same language, the processor with the higher precedence will be selected.- Returns:
- precedence
-
supports
Checks if the specified language is supported.- Parameters:
ln- language- Returns:
- true if language is supported
-
equals
-
compareTo
public final int compareTo(org.basex.util.ft.LanguageImpl o) - Specified by:
compareToin interfaceComparable<org.basex.util.ft.LanguageImpl>
-
hashCode
public int hashCode()
-