edu.mit.jmwe.detect
Class Perfect
java.lang.Object
edu.mit.jmwe.detect.Perfect
- All Implemented Interfaces:
- IMWEDetector
public class Perfect
- extends Object
- implements IMWEDetector
A detector that finds all of the MWEs in a sentence by using an answer key.
Sentences passed to this detector must implement IMarkedSentence
,
otherwise the detect(List)
method will throw an exception.
- Since:
- jMWE 1.0.0
- Version:
- $Id: Perfect.java 612 2011-05-06 20:22:54Z markaf $
- Author:
- M.A. Finlayson
Constructor Summary |
Perfect(IAnswerKey key)
Constructs a new detector that uses the specified answer key |
Method Summary |
|
detect(List<T> sentence)
Given a list of tokens, the detector searches for the MWEs in the list. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Perfect
public Perfect(IAnswerKey key)
- Constructs a new detector that uses the specified answer key
- Parameters:
key
- - 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
- 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
Copyright © 2011 Massachusetts Institute of Technology. All Rights Reserved.