|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<IConcordanceToken>
edu.mit.jmwe.data.concordance.ConcordanceSentence
public class ConcordanceSentence
Default implementation of ISemcorSentence
This class requires JSemcor to be on the classpath.
Field Summary | |
---|---|
static Pattern |
taggedSemcorSentencePattern
A compiled regular expression pattern that captures the string representation of a Semcor sentence. |
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
ConcordanceSentence(edu.mit.jsemcor.element.IContextID cid,
int sentNum,
List<? extends IConcordanceToken> tokens)
Constructs a new semcor sentence from the list of tokens. |
|
ConcordanceSentence(edu.mit.jsemcor.element.IContextID cid,
edu.mit.jsemcor.element.ISentence sent)
Constructs a new semcor sentence from the specified context id and JSemcor sentence object. |
Method Summary | |
---|---|
IConcordanceToken |
get(int index)
|
edu.mit.jsemcor.element.IContextID |
getContextID()
Returns the context id from which this sentence was drawn. |
String |
getID()
Returns an ID string that uniquely identifies this object or object type. |
int |
getSentenceNumber()
Returns the sentence number of this sentence in the specified Semcor context. |
static String |
makeID(edu.mit.jsemcor.element.IContextID cid,
int sentNum)
Returns a string ID constructed from the given IContextID and
sentence number. |
static ConcordanceSentence |
parse(String toString)
Parses a string formed from the a string of the form |
int |
size()
|
String |
toString()
|
Methods inherited from class java.util.AbstractList |
---|
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList |
Methods inherited from class java.util.AbstractCollection |
---|
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
add, add, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, subList, toArray, toArray |
Field Detail |
---|
public static final Pattern taggedSemcorSentencePattern
Constructor Detail |
---|
public ConcordanceSentence(edu.mit.jsemcor.element.IContextID cid, edu.mit.jsemcor.element.ISentence sent)
cid
- the context id for the JSemcor sentence; may not be
null
sent
- the JSemcor sentence; may not be null
NullPointerException
- if either argument is null
public ConcordanceSentence(edu.mit.jsemcor.element.IContextID cid, int sentNum, List<? extends IConcordanceToken> tokens)
cid
- the context id for the JSemcor sentence; may not be
null
sentNum
- the sentence number; must be positivetokens
- the list of tokens that will make up this list, may not be
null
or empty
NullPointerException
- if the context id, or the list of source tokens is
null
or contains null
IllegalArgumentException
- if the sentence number is non-positive, or the list is emptyMethod Detail |
---|
public String getID()
IHasID
null
.
getID
in interface IHasID
public edu.mit.jsemcor.element.IContextID getContextID()
IConcordanceSentence
null
.
getContextID
in interface IConcordanceSentence
null
context id from which this sentence was
drawn.public int getSentenceNumber()
IConcordanceSentence
getSentenceNumber
in interface IConcordanceSentence
public IConcordanceToken get(int index)
get
in interface List<IConcordanceToken>
get
in class AbstractList<IConcordanceToken>
public int size()
size
in interface Collection<IConcordanceToken>
size
in interface List<IConcordanceToken>
size
in class AbstractCollection<IConcordanceToken>
public String toString()
toString
in class AbstractCollection<IConcordanceToken>
public static ConcordanceSentence parse(String toString)
concordanceName/contextID/sentNumber [tok_tag_stems_num_part]+into a
ConcordanceSentence
instance.
toString
- the string representing the tagged semcor sentence.
NullPointerException
- if the specified string is null
IllegalArgumentException
- if the specified string does not conform to the expected
formatpublic static String makeID(edu.mit.jsemcor.element.IContextID cid, int sentNum)
IContextID
and
sentence number. For the Semcor corpus, this ID has the form:
brown1/br-a01/1
cid
- the context idsentNum
- the sentence number
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |