edu.mit.jmwe.data
Class InfMWEDesc

java.lang.Object
  extended by edu.mit.jmwe.data.AbstractMWEDesc<IInfMWEDesc.IInfPart>
      extended by edu.mit.jmwe.data.InfMWEDesc
All Implemented Interfaces:
IHasForm, IHasMWEPOS, IInfMWEDesc, IMWEDesc, Comparable<IMWEDesc>
Direct Known Subclasses:
IndexBuilder.MutableInfMWEDesc

public class InfMWEDesc
extends AbstractMWEDesc<IInfMWEDesc.IInfPart>
implements IInfMWEDesc

Default implementation of the IInfMWEDesc interface.

Since:
jMWE 1.0.0
Version:
$Id: InfMWEDesc.java 595 2011-05-06 01:58:29Z markaf $
Author:
M.A. Finlayson

Nested Class Summary
static class InfMWEDesc.InfMWEDescBuilder
          A builder for inflected MWE description objecgts
protected  class InfMWEDesc.InfPart
          Default implementation of the IInfMWEDesc.IInfPart interface.
 
Nested classes/interfaces inherited from class edu.mit.jmwe.data.AbstractMWEDesc
AbstractMWEDesc.AbstractPart
 
Nested classes/interfaces inherited from interface edu.mit.jmwe.data.IInfMWEDesc
IInfMWEDesc.IInfPart
 
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.IInfMWEDesc
EXPECTED_COUNT_LENGTH
 
Fields inherited from interface edu.mit.jmwe.data.IMWEDesc
boundaryUnderscores, comma, underscore, underscores
 
Constructor Summary
InfMWEDesc(IRootMWEDesc root, List<String> parts)
          Constructs a new inflected MWE description object from the specified list of parts and root description
InfMWEDesc(IRootMWEDesc root, List<String> parts, int... counts)
          Constructs a new MWE description object from the list of parts.
InfMWEDesc(IRootMWEDesc root, String inflectedForm)
          Constructs a new MWE description object from the specified root description and inflected form.
InfMWEDesc(IRootMWEDesc root, String inflectedForm, int... counts)
          Constructs a new inflected MWE description object from the specified inflected form, root description, and counts relating to the MWE's appearance in the reference concordance.
 
Method Summary
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.
 int getMarkedPattern()
          The number of times this description occurs in the reference concordance being marked as an occurrence of the MWE, while matching one of the known inflection patterns.
 MWEPOS getPOS()
          Returns the part of speech of this object.
 IRootMWEDesc getRootMWEDesc()
          Returns the root description of the multi-word expression (MWE).
protected  IInfMWEDesc.IInfPart 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.
 
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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.mit.jmwe.data.IInfMWEDesc
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

InfMWEDesc

public InfMWEDesc(IRootMWEDesc root,
                  String inflectedForm)
Constructs a new MWE description object from the specified root description and inflected form.

Parameters:
root - the root description of the MWE
inflectedForm - A string representing the inflected MWE with its words separated by underscores
Throws:
NullPointerException - if either argument is null
IllegalArgumentException - if the inflected form does not contain underscores
Since:
jMWE 1.0.0

InfMWEDesc

public InfMWEDesc(IRootMWEDesc root,
                  String inflectedForm,
                  int... counts)
Constructs a new inflected MWE description object from the specified inflected form, root description, and counts relating to the MWE's appearance in the reference concordance.

Parameters:
root - the root description of the MWE
inflectedForm - A string representing the inflected MWE with its words separated by underscores
counts - the counts relating to the MWE's appearance in the reference concordance.
Throws:
NullPointerException - if the root description or inflected form is null
IllegalArgumentException - if the inflected form does not contain underscores
Since:
jMWE 1.0.0

InfMWEDesc

public InfMWEDesc(IRootMWEDesc root,
                  List<String> parts)
Constructs a new inflected MWE description object from the specified list of parts and root description

Parameters:
root - the root description of the MWE
parts - A list of parts that comprise the MWE
Throws:
NullPointerException - if the list of parts or root 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 whitespace
Since:
jMWE 1.0.0

InfMWEDesc

public InfMWEDesc(IRootMWEDesc root,
                  List<String> parts,
                  int... counts)
Constructs a new MWE description object from the list of parts. This constructor allocates a new internal list, and so subsequent changes to the source list will not affect this object.

Parameters:
parts - the list of parts that will make up this list, may neither be null nor empty, and may not contain any nulls, empty or all whitespace strings, or strings that contain the underscore character.
Throws:
NullPointerException - if the specified list of parts is null, or contains a 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 whitespace
Since:
jMWE 1.0.0
Method Detail

getExpectedCountLength

protected int getExpectedCountLength()
Description copied from class: AbstractMWEDesc
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.

Specified by:
getExpectedCountLength in class AbstractMWEDesc<IInfMWEDesc.IInfPart>
Returns:
the number of counts relating to the MWE's appearance in a reference concordance.

getID

public IMWEDescID getID()
Description copied from interface: IMWEDesc
Returns the IMWEDescID associated with this description.

Specified by:
getID in interface IMWEDesc
Returns:
the IMWEDescID associated with this description. Never null.

getPOS

public MWEPOS getPOS()
Description copied from interface: IHasMWEPOS
Returns the part of speech of this object. May not return null.

Specified by:
getPOS in interface IHasMWEPOS
Returns:
the non-null part of speech of the MWE.

getRootMWEDesc

public IRootMWEDesc getRootMWEDesc()
Description copied from interface: IInfMWEDesc
Returns the root description of the multi-word expression (MWE). IThis description includes the lemma, a list of parts, and part of speech of the multi-word expression.

Specified by:
getRootMWEDesc in interface IInfMWEDesc
Returns:
the description of the non-inflected form of this multi-word expression (MWE).

getMarkedPattern

public int getMarkedPattern()
Description copied from interface: IInfMWEDesc
The number of times this description occurs in the reference concordance being marked as an occurrence of the MWE, while matching one of the known inflection patterns. To be counted as a pattern-inflected unmarked occurrence, there must be a continuous run of tokens whose forms or stems match, in order, the forms of the parts (ignoring case) of this MWE description, and whose inflection pattern matches one of reference inflection patterns. Will always zero or a positive number.

Specified by:
getMarkedPattern in interface IInfMWEDesc
Returns:
the number of inflected unmarked occurrences of this MWE in the reference concordance.

makePart

protected IInfMWEDesc.IInfPart makePart(String form,
                                        int index)
Description copied from class: AbstractMWEDesc
Subclasses should implement this method to construct an IMWEDesc.IPart given the form and index of a part of an MWE.

Specified by:
makePart in class AbstractMWEDesc<IInfMWEDesc.IInfPart>
Parameters:
form - the text of the part
index - the index of the part in the MWE


Copyright © 2011 Massachusetts Institute of Technology. All Rights Reserved.