edu.stanford.nlp.objectbank
Class XMLBeginEndIterator
java.lang.Object
edu.stanford.nlp.util.AbstractIterator
edu.stanford.nlp.objectbank.XMLBeginEndIterator
- All Implemented Interfaces:
- java.util.Iterator
public class XMLBeginEndIterator
- extends AbstractIterator
A class which iterates over Strings occuring between the begin and end of
a selected tag or tags (specified by a regexp, matched as
matches()
.
Ignores all other characters in the input Reader.
Constructor Summary |
XMLBeginEndIterator(java.io.Reader in,
java.lang.String tagNameRegexp)
|
XMLBeginEndIterator(java.io.Reader in,
java.lang.String tagNameRegexp,
boolean keepInternalTags)
|
XMLBeginEndIterator(java.io.Reader in,
java.lang.String tagNameRegexp,
boolean keepInternalTags,
boolean keepDelimitingTags)
|
XMLBeginEndIterator(java.io.Reader in,
java.lang.String tagNameRegexp,
Function op,
boolean keepInternalTags)
|
XMLBeginEndIterator(java.io.Reader in,
java.lang.String tagNameRegexp,
Function op,
boolean keepInternalTags,
boolean keepDelimitingTags)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XMLBeginEndIterator
public XMLBeginEndIterator(java.io.Reader in,
java.lang.String tagNameRegexp)
XMLBeginEndIterator
public XMLBeginEndIterator(java.io.Reader in,
java.lang.String tagNameRegexp,
boolean keepInternalTags)
XMLBeginEndIterator
public XMLBeginEndIterator(java.io.Reader in,
java.lang.String tagNameRegexp,
Function op,
boolean keepInternalTags)
XMLBeginEndIterator
public XMLBeginEndIterator(java.io.Reader in,
java.lang.String tagNameRegexp,
boolean keepInternalTags,
boolean keepDelimitingTags)
XMLBeginEndIterator
public XMLBeginEndIterator(java.io.Reader in,
java.lang.String tagNameRegexp,
Function op,
boolean keepInternalTags,
boolean keepDelimitingTags)
parseString
protected java.lang.Object parseString(java.lang.String s)
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interface java.util.Iterator
- Specified by:
hasNext
in class AbstractIterator
next
public java.lang.Object next()
- Specified by:
next
in interface java.util.Iterator
- Specified by:
next
in class AbstractIterator
peek
public java.lang.Object peek()
getFactory
public static IteratorFromReaderFactory getFactory(java.lang.String tag)
- Returns a factory that vends BeginEndIterators that reads the contents of
the given Reader, extracts text between the specified Strings, then
returns the result.
- Parameters:
tag
-
getFactory
public static IteratorFromReaderFactory getFactory(java.lang.String tag,
Function op)
getFactory
public static IteratorFromReaderFactory getFactory(java.lang.String tag,
Function op,
boolean keepInternalTags,
boolean keepDelimitingTags)
main
public static void main(java.lang.String[] args)
throws java.lang.Exception
- Throws:
java.lang.Exception