public class CompositeDetector extends java.util.AbstractList<IMWEDetector> implements IMWEDetector
Constructor and Description |
---|
CompositeDetector(IMWEDetector... ds)
Constructs a composite detector from an array of detectors.
|
CompositeDetector(java.util.List<? extends IMWEDetector> ds)
Constructs a composite detector from a list of detectors.
|
Modifier and Type | Method and Description |
---|---|
<T extends IToken> |
detect(java.util.List<T> sentence)
Given a list of tokens, the detector searches for the MWEs in the list.
|
IMWEDetector |
get(int index) |
int |
size() |
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
public CompositeDetector(IMWEDetector... ds)
ds
- the array of detectors in order of descending preference. May
not be null
. May not contain any null
detectors.java.lang.NullPointerException
- if the specified array is null
or if any of the detectors
in the list are null
.public CompositeDetector(java.util.List<? extends IMWEDetector> ds)
ds
- the list of detectors in order of descending preference. May
not be null
. May not contain any null
detectors.java.lang.NullPointerException
- if the specified list is null
or if any of the detectors
in the list are null
.public <T extends IToken> java.util.List<IMWE<T>> detect(java.util.List<T> sentence)
IMWEDetector
IMWE
objects representing these
multi-word expressions. The method returns an empty list if no MWEs are
found; the method should never return null
.detect
in interface IMWEDetector
T
- the type of the tokens in the sentencesentence
- a sentence which the detector should search for multi-word
expressions.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
public IMWEDetector get(int index)
get
in interface java.util.List<IMWEDetector>
get
in class java.util.AbstractList<IMWEDetector>
public int size()
size
in interface java.util.Collection<IMWEDetector>
size
in interface java.util.List<IMWEDetector>
size
in class java.util.AbstractCollection<IMWEDetector>
Copyright © 2011 Massachusetts Institute of Technology. All Rights Reserved.