edu.mit.jmwe.detect
Class InflectionLookup
java.lang.Object
edu.mit.jmwe.detect.HasMWEDetector
edu.mit.jmwe.detect.InflectionLookup
- All Implemented Interfaces:
- IHasMWEDetector, IMWEDetector, IMWEDetectorFilter
public class InflectionLookup
- extends HasMWEDetector
- implements IMWEDetectorFilter
Uses a given MWE detector to find multi-word expressions in a sentence but
discards inflected multi-word expressions whose form is not listed as a valid
inflected form by its associated IMWEDesc
.
- Since:
- jMWE 1.0.0
- Version:
- $Id: InflectionLookup.java 610 2011-05-06 20:05:20Z markaf $
- Author:
- N. Kulkarni, M.A. Finlayson
Method Summary |
|
detect(List<T> sentence)
Given a list of tokens, the detector searches for the MWEs in the list. |
static
|
getSurfaceFormDescription(IRootMWEDesc root,
IMWE<T> mwe)
Returns a multi-word expression description with a lemma that is
constructed by concatenating the tokens of the MWE exactly as they appear
in the sentence with underscores. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
InflectionLookup
public InflectionLookup(IMWEDetector d)
- Constructs the detector from the given backing detector.
- Parameters:
d
- the IMWEDetector that will be used to back this detector. May
not be null.
- Throws:
NullPointerException
- if the backing detector is null- Since:
- jMWE 1.0.0
detect
public <T extends IToken> List<IMWE<T>> detect(List<T> sentence)
- Description copied from interface:
IMWEDetector
- Given a list of tokens, the detector searches for the MWEs in the list.
It returns a set of
IMWE
objects representing these
multi-word expressions. The method returns an empty list if no MWEs are
found; the method should never return null
.
- Specified by:
detect
in interface IMWEDetector
- Overrides:
detect
in class HasMWEDetector
- Type Parameters:
T
- the type of the tokens in the sentence- Parameters:
sentence
- a sentence which the detector should search for multi-word
expressions.
- Returns:
- a list of
IMWE
objects representing the multi-word
expressions found in the sentence. Returns an empty list if no
multi-word expressions are found; never returns null
getSurfaceFormDescription
public static <T extends IToken> IInfMWEDesc getSurfaceFormDescription(IRootMWEDesc root,
IMWE<T> mwe)
- Returns a multi-word expression description with a lemma that is
constructed by concatenating the tokens of the MWE exactly as they appear
in the sentence with underscores.
- Type Parameters:
T
- the type of token- Parameters:
root
- the cognizant rootmwe
- the multi-word expression used to construct the description
object
- Returns:
- the description of the given MWE with a lemma that is constructed
by concatenating the tokens of the MWE exactly as they appear in
the sentence, preserving inflection rather than using the base
form as the lemma.
- Since:
- jMWE 1.0.0
Copyright © 2011 Massachusetts Institute of Technology. All Rights Reserved.