|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.mit.jmwe.data.AbstractMWEDesc<IRootMWEDesc.IRootPart>
edu.mit.jmwe.data.RootMWEDesc
public class RootMWEDesc
Default implementation of the IRootMWEDesc
interface.
Nested Class Summary | |
---|---|
protected class |
RootMWEDesc.Part
Default implementation of IRootMWEDesc.IRootPart . |
Nested classes/interfaces inherited from class edu.mit.jmwe.data.AbstractMWEDesc |
---|
AbstractMWEDesc.AbstractPart |
Nested classes/interfaces inherited from interface edu.mit.jmwe.data.IRootMWEDesc |
---|
IRootMWEDesc.IRootPart |
Nested classes/interfaces inherited from interface edu.mit.jmwe.data.IMWEDesc |
---|
IMWEDesc.IPart |
Field Summary |
---|
Fields inherited from class edu.mit.jmwe.data.AbstractMWEDesc |
---|
counts |
Fields inherited from interface edu.mit.jmwe.data.IRootMWEDesc |
---|
EXPECTED_COUNT_LENGTH |
Fields inherited from interface edu.mit.jmwe.data.IMWEDesc |
---|
boundaryUnderscores, comma, underscore, underscores |
Constructor Summary | |
---|---|
RootMWEDesc(List<String> parts,
MWEPOS pos)
Constructs a new MWE description object from the specified list of parts and part of speech, that has no inflected forms |
|
RootMWEDesc(List<String> parts,
MWEPOS pos,
Collection<? extends InfMWEDesc.InfMWEDescBuilder> inflectedForms,
int... counts)
Constructs a new MWE description object from the specified list of parts, inflected forms, part of speech, and counts relating to the MWE's appearance in the reference concordance. |
|
RootMWEDesc(String surfaceForm,
MWEPOS pos)
Constructs a new MWE description object from the specified surface form and part of speech, that has no inflected forms |
|
RootMWEDesc(String surfaceForm,
MWEPOS pos,
Collection<? extends InfMWEDesc.InfMWEDescBuilder> inflectedForms,
int... counts)
Constructs a new MWE description object from the specified surface form, inflected forms, part of speech, and counts relating to the MWE's appearance in the reference concordance. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
|
protected int |
getExpectedCountLength()
Subclasses should implement this method to return the number of counts relating to the MWE's appearance in a reference concordance that are expected in the implementation. |
IMWEDescID |
getID()
Returns the IMWEDescID associated with this description. |
Map<String,? extends IInfMWEDesc> |
getInflected()
Returns an unmodifiable set of MWE descriptions corresponding to the inflected versions of this form. |
MWEPOS |
getPOS()
Returns the part of speech of this object. |
int |
getUnmarkedInflected()
Returns the number of times an inflected form of this MWE description occurs in the reference concordance without being marked as an occurrence of the MWE, and without being an exact match to a known inflected form of this root. |
int |
hashCode()
|
protected IRootMWEDesc.IRootPart |
makePart(String form,
int index)
Subclasses should implement this method to construct an IMWEDesc.IPart
given the form and index of a part of an MWE. |
static IRootMWEDesc |
parse(String descStr)
Parses the given description string into a root mwe description object. |
static int[] |
parseCounts(String countStr)
Parses a string of counts separated by commas into an array of integers. |
static void |
toString(int[] counts,
Appendable buf)
Returns a string containing the given counts as |
static String |
toString(IRootMWEDesc mweDesc)
Returns the String representation of the given description. |
static void |
toString(IRootMWEDesc root,
Appendable buf)
Returns the String representation of the given description as: |
Methods inherited from class edu.mit.jmwe.data.AbstractMWEDesc |
---|
checkCount, compareTo, concatenate, equalsRoots, getCounts, getForm, getMarkedContinuous, getMarkedSplit, getParts, getRoot, getUnmarkedExact, getUnmarkedPattern, isFillerForSlot, isStopWord, splitOnUnderscores, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface edu.mit.jmwe.data.IRootMWEDesc |
---|
getParts |
Methods inherited from interface edu.mit.jmwe.data.IMWEDesc |
---|
getCounts, getMarkedContinuous, getMarkedSplit, getUnmarkedExact, getUnmarkedPattern |
Methods inherited from interface edu.mit.jmwe.data.IHasForm |
---|
getForm |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Constructor Detail |
---|
public RootMWEDesc(String surfaceForm, MWEPOS pos)
surfaceForm
- A string representing the MWE with its words separated by
underscorespos
- The part of speech object representing the part of speech of
the MWE
NullPointerException
- if either argument is null
IllegalArgumentException
- if the surface form does not contain underscorespublic RootMWEDesc(String surfaceForm, MWEPOS pos, Collection<? extends InfMWEDesc.InfMWEDescBuilder> inflectedForms, int... counts)
surfaceForm
- A string representing the MWE with its words separated by
underscorespos
- The part of speech object representing the part of speech of
the MWEinflectedForms
- the collection of builders used to create the descriptions of
the inflected forms of this MWE.counts
- the counts relating to the MWE's appearance in the reference
concordance.
NullPointerException
- if the surface form or pos is null
IllegalArgumentException
- if the surface form does not contain underscorespublic RootMWEDesc(List<String> parts, MWEPOS pos)
parts
- A list of parts that comprise the MWEpos
- The part of speech object representing the part of speech of
the MWE
NullPointerException
- if either argument is null
IllegalArgumentException
- if the specified list has less than two elements, or any
trimmed string in the list contains an underscore, is empty,
or contains whitespacepublic RootMWEDesc(List<String> parts, MWEPOS pos, Collection<? extends InfMWEDesc.InfMWEDescBuilder> inflectedForms, int... counts)
parts
- A list of parts that comprise the MWEpos
- The part of speech object representing the part of speech of
the MWEinflectedForms
- the collection of builders used to create the descriptions of
the inflected forms of this MWE.counts
- the counts relating to the MWE's appearance in the reference
concordance.
NullPointerException
- if the list of parts or pos is null
IllegalArgumentException
- if the specified list has less than two elements, or any
trimmed string in the list contains an underscore, is empty,
or contains whitespaceMethod Detail |
---|
protected int getExpectedCountLength()
AbstractMWEDesc
getExpectedCountLength
in class AbstractMWEDesc<IRootMWEDesc.IRootPart>
protected IRootMWEDesc.IRootPart makePart(String form, int index)
AbstractMWEDesc
IMWEDesc.IPart
given the form and index of a part of an MWE.
makePart
in class AbstractMWEDesc<IRootMWEDesc.IRootPart>
form
- the text of the partindex
- the index of the part in the MWEpublic IMWEDescID getID()
IMWEDesc
getID
in interface IMWEDesc
null
.public MWEPOS getPOS()
IHasMWEPOS
null
.
getPOS
in interface IHasMWEPOS
public Map<String,? extends IInfMWEDesc> getInflected()
IRootMWEDesc
null
, this means the no inflected forms have yet been
assigned.
getInflected
in interface IRootMWEDesc
null
, possibly empty set of inflected MWE
descriptions.public int getUnmarkedInflected()
IRootMWEDesc
getUnmarkedInflected
in interface IRootMWEDesc
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public static String toString(IRootMWEDesc mweDesc)
mweDesc
- the description to be represented as a String.
public static void toString(IRootMWEDesc root, Appendable buf) throws IOException
id count[0],count[1], ...,count[n] inf[1] inf[2] ... inf[m]
inf[i] is an inflected form of the MWE represented as:infForm count[0],count[1], ...,count[n]
root
- the description to be represented as a String.buf
- the appendable buffer used to build the String.
IOException
public static void toString(int[] counts, Appendable buf) throws IOException
count[0],count[1], ...,count[n]
counts
- the counts to be represented as a Stringbuf
- the appendable buffer used to build the String.
IOException
public static IRootMWEDesc parse(String descStr)
descStr
- the string to be parsed
IRootMWEDesc
containing the fields specified in the
given string.public static int[] parseCounts(String countStr)
countStr
- the string to be parsed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |