Class AccurateSrxTextIterator
java.lang.Object
net.loomchild.segment.AbstractTextIterator
net.loomchild.segment.srx.legacy.AccurateSrxTextIterator
- All Implemented Interfaces:
Iterator<String>, TextIterator
Reprezentuje splitter dzielący na podstawie reguł zawartych w pliku srx.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate List<LanguageRule> private List<RuleMatcher> private Stringprivate intprivate CharSequence -
Constructor Summary
ConstructorsConstructorDescriptionAccurateSrxTextIterator(SrxDocument document, String languageCode, CharSequence text) Creates text iterator that obtains language rules form given document using given language code. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidMove matchers that start before previous segment end.private RuleMatcherbooleanhasNext()private voidprivate voidPrzesuwa iteratory na kolejną pozycje jeśli to konieczne.next()Wyszukuje następne dopasowanie.Methods inherited from class AbstractTextIterator
remove, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterator
forEachRemaining
-
Field Details
-
languageRuleList
-
text
-
segment
-
ruleMatcherList
-
startPosition
private int startPosition -
endPosition
private int endPosition
-
-
Constructor Details
-
AccurateSrxTextIterator
Creates text iterator that obtains language rules form given document using given language code. To retrieve language rules callsSrxDocument.getLanguageRuleList(String).- Parameters:
document- document containing language ruleslanguageCode- language code to select the rulestext-
-
-
Method Details
-
next
Wyszukuje następne dopasowanie.- Returns:
- Zwraca następny segment albo null jeśli nie istnieje
-
hasNext
public boolean hasNext()- Returns:
- Zwraca true gdy są dostępne kolejne segmenty
-
initMatchers
private void initMatchers() -
moveMatchers
private void moveMatchers()Przesuwa iteratory na kolejną pozycje jeśli to konieczne. -
cutMatchers
private void cutMatchers()Move matchers that start before previous segment end. -
getMinMatcher
- Returns:
- Zwraca iterator pierwszego trafionego dopasowania
-