Package net.loomchild.segment.srx.legacy
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 int
private List<LanguageRule>
private List<RuleMatcher>
private String
private int
private 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 void
Move matchers that start before previous segment end.private RuleMatcher
boolean
hasNext()
private void
private void
Przesuwa iteratory na kolejną pozycje jeśli to konieczne.next()
Wyszukuje następne dopasowanie.Methods inherited from class net.loomchild.segment.AbstractTextIterator
remove, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.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
- Throws:
IOSRuntimeException
- Zgłaszany gdy nastąpi błąd przy odczycie strumienia
-
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
-