public class RootMWEDesc extends AbstractMWEDesc<IRootMWEDesc.IRootPart> implements IRootMWEDesc
IRootMWEDesc
interface.Modifier and Type | Class and Description |
---|---|
protected class |
RootMWEDesc.Part
Default implementation of
IRootMWEDesc.IRootPart . |
AbstractMWEDesc.AbstractPart
IRootMWEDesc.IRootPart
IMWEDesc.IPart
counts
EXPECTED_COUNT_LENGTH
boundaryUnderscores, comma, underscore, underscores
Constructor and Description |
---|
RootMWEDesc(java.util.List<java.lang.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(java.util.List<java.lang.String> parts,
MWEPOS pos,
java.util.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(java.lang.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(java.lang.String surfaceForm,
MWEPOS pos,
java.util.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.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.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.
|
java.util.Map<java.lang.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(java.lang.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(java.lang.String descStr)
Parses the given description string into a root mwe description object.
|
static int[] |
parseCounts(java.lang.String countStr)
Parses a string of counts separated by commas into an array of integers.
|
static void |
toString(int[] counts,
java.lang.Appendable buf)
Returns a string containing the given counts as
|
static java.lang.String |
toString(IRootMWEDesc mweDesc)
Returns the String representation of the given description.
|
static void |
toString(IRootMWEDesc root,
java.lang.Appendable buf)
Returns the String representation of the given description as:
|
checkCount, compareTo, concatenate, equalsRoots, getCounts, getForm, getMarkedContinuous, getMarkedSplit, getParts, getRoot, getUnmarkedExact, getUnmarkedPattern, isFillerForSlot, isStopWord, splitOnUnderscores, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getParts
getCounts, getMarkedContinuous, getMarkedSplit, getUnmarkedExact, getUnmarkedPattern
public RootMWEDesc(java.lang.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 MWEjava.lang.NullPointerException
- if either argument is null
java.lang.IllegalArgumentException
- if the surface form does not contain underscorespublic RootMWEDesc(java.lang.String surfaceForm, MWEPOS pos, java.util.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.java.lang.NullPointerException
- if the surface form or pos is null
java.lang.IllegalArgumentException
- if the surface form does not contain underscorespublic RootMWEDesc(java.util.List<java.lang.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 MWEjava.lang.NullPointerException
- if either argument is null
java.lang.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(java.util.List<java.lang.String> parts, MWEPOS pos, java.util.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.java.lang.NullPointerException
- if the list of parts or pos is null
java.lang.IllegalArgumentException
- if the specified list has less than two elements, or any
trimmed string in the list contains an underscore, is empty,
or contains whitespaceprotected int getExpectedCountLength()
AbstractMWEDesc
getExpectedCountLength
in class AbstractMWEDesc<IRootMWEDesc.IRootPart>
protected IRootMWEDesc.IRootPart makePart(java.lang.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 MWEnull
public IMWEDescID getID()
IMWEDesc
public MWEPOS getPOS()
IHasMWEPOS
null
.getPOS
in interface IHasMWEPOS
public java.util.Map<java.lang.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 java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public static java.lang.String toString(IRootMWEDesc mweDesc)
mweDesc
- the description to be represented as a String.public static void toString(IRootMWEDesc root, java.lang.Appendable buf) throws java.io.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.java.io.IOException
- if there is an exception while appending the provided buffer.public static void toString(int[] counts, java.lang.Appendable buf) throws java.io.IOException
count[0],count[1], ...,count[n]
counts
- the counts to be represented as a Stringbuf
- the appendable buffer used to build the String.java.io.IOException
- if there is an exception while appending the provided buffer.public static IRootMWEDesc parse(java.lang.String descStr)
descStr
- the string to be parsedIRootMWEDesc
containing the fields specified in the
given string.public static int[] parseCounts(java.lang.String countStr)
countStr
- the string to be parsed.Copyright © 2011 Massachusetts Institute of Technology. All Rights Reserved.