|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.mit.jmwe.detect.MWEBuilder<T>
public class MWEBuilder<T extends IToken>
A record that is used to hold tokens as the detector passes over a sentence. Contains empty slots for each part of a multi-word expression. Each slot can be filled by a token that matches the part.
Constructor Summary | |
---|---|
MWEBuilder(IMWEDesc entry,
Comparator<T> comparator)
Constructs an empty record from an IRootMWEDesc object. |
|
MWEBuilder(IMWEDesc entry,
List<T> sentence)
Constructs an empty record from the given MWE description and sentence. |
Method Summary | ||
---|---|---|
MWEBuilder<T> |
clone()
|
|
boolean |
equals(Object obj)
|
|
static
|
fillNextSlot(MWEBuilder<T> builder,
T t)
Fills the first non-null (empty) slot in the given builder. |
|
static
|
fillSlots(Set<MWEBuilder<T>> records,
T token)
Given a set of MWE builders, fills all the slots in the records that can be filled by the given token. |
|
IMWEDesc |
getEntry()
Returns the multi-word expression description object corresponding to the record. |
|
SortedMap<IMWEDesc.IPart,T> |
getSlots()
Returns the slots of this record. |
|
boolean |
hasEmptyMatchingSlots(Map.Entry<IMWEDesc.IPart,T> slot)
Returns true if the matching slots after the given slot in this record are empty. |
|
int |
hashCode()
|
|
boolean |
hasMultiple()
Returns true if the record contains two or more slots whose index parts have the same part lemma. |
|
boolean |
isContentFull()
Returns true if the all of the content words in this record are full. |
|
boolean |
isFull()
Returns true if all the slots in this record contain a token. |
|
boolean |
isPartOfSpeechSatisfied()
Returns true if at least one token in one slot matches the
part of speech of the MWE description; false otherwise. |
|
IMWE<T> |
toMWE()
Converts the tokens in a full record into an IMWE object. |
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MWEBuilder(IMWEDesc entry, List<T> sentence)
entry
- the description of the MWE associated with this recordsentence
- the sentence from which the tokens used to fill this record
will be drawnpublic MWEBuilder(IMWEDesc entry, Comparator<T> comparator)
IRootMWEDesc
object.
entry
- a multi-word expression description. May not be
null
.
NullPointerException
- if the description is null
.Method Detail |
---|
public IMWEDesc getEntry()
public SortedMap<IMWEDesc.IPart,T> getSlots()
null
if the slot
has not yet been filled.
SortedMap
that maps each index part of
the multi-word expression to a token or to null
if the slot
has not yet been filled.public boolean isFull()
public boolean isContentFull()
public boolean isPartOfSpeechSatisfied()
true
if at least one token in one slot matches the
part of speech of the MWE description; false
otherwise.
true
if at least one token in one slot matches the
part of speech of the MWE description; false
otherwise.public boolean hasEmptyMatchingSlots(Map.Entry<IMWEDesc.IPart,T> slot)
slot
- the slot in consideration. May not be null
.
public boolean hasMultiple()
public MWEBuilder<T> clone()
clone
in class Object
public IMWE<T> toMWE()
IMWE
object. If this record is not full,
returns null
.
null
otherwise.public String toString()
toString
in class Object
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public static <T extends IToken> void fillSlots(Set<MWEBuilder<T>> records, T token)
T
- type of tokens the records holdrecords
- a set of records whose slots may be filled. May not be
null
.token
- the token that will be used to fill the appropriate slots in
the records. May not be null
.
NullPointerException
- if either parameter is null
.public static <T extends IToken> boolean fillNextSlot(MWEBuilder<T> builder, T t)
builder
- the builder to be filledt
- the token to fill the builder's next open slot with
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |