|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.mit.jmwe.data.concordance.TaggedConcordanceIterator
public class TaggedConcordanceIterator
An iterator over a list of tagged concodrance sentences. This iterator does not
support the remove()
operation. Each tagged sentence must be on its
own line, in the following format:
concordanceName/contextID/sentNumber [tok_tag_stems_num_part]+
ConcordanceTagger
Field Summary | |
---|---|
protected IConcordanceSentence |
next
|
protected BufferedReader |
source
|
Constructor Summary | |
---|---|
TaggedConcordanceIterator(File file)
Constructs the iterator form the given source file. |
|
TaggedConcordanceIterator(Reader r)
Constructs the iterator from a reader. |
|
TaggedConcordanceIterator(URL url)
Constructs the iterator from a URL pointing to a list of tagged
semcor sentences. |
Method Summary | |
---|---|
protected void |
advance()
Internal method used to advance the iterator to the next element in the list. |
boolean |
hasNext()
|
protected boolean |
ignoreLine(String line)
Indicates whether the specified line is to be ignored. |
IConcordanceSentence |
next()
|
void |
remove()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final BufferedReader source
protected IConcordanceSentence next
Constructor Detail |
---|
public TaggedConcordanceIterator(File file) throws IOException
file
- the source file of tagged sentences in the proper format.
IOException
- if an IOException occurs when opening or reading from the
file.public TaggedConcordanceIterator(URL url) throws IOException
URL
pointing to a list of tagged
semcor sentences.
url
- a url pointing to a list of tagged semcor sentences, may not
be null
NullPointerException
- if source is null
IOException
public TaggedConcordanceIterator(Reader r) throws IOException
r
- the reader from which the data is read
IOException
- if there is an exception reading from the reader
NullPointerException
- if the reader is null
Method Detail |
---|
public IConcordanceSentence next()
next
in interface Iterator<IConcordanceSentence>
protected void advance() throws IOException
IOException
- if the reader reaches the end of the file (there are no
elements left)protected boolean ignoreLine(String line)
true
. Lines consisting of all whitespace will also
cause this method to return true
. Otherwise, the method
returns false
.
line
- the line being considered
public boolean hasNext()
hasNext
in interface Iterator<IConcordanceSentence>
public void remove()
remove
in interface Iterator<IConcordanceSentence>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |