edu.berkeley.nlp.lm.map
Class NgramsForOrderMapWrapper<W,V>
java.lang.Object
java.util.AbstractMap<List<W>,V>
edu.berkeley.nlp.lm.map.NgramsForOrderMapWrapper<W,V>
- Type Parameters:
W
- V
-
- All Implemented Interfaces:
- Map<List<W>,V>
public class NgramsForOrderMapWrapper<W,V>
- extends AbstractMap<List<W>,V>
Wraps an NgramMap as a Java Map, but only ngrams of a particular order. This
collection is read-only. It is also uses a lot inefficient boxing and
unboxing.
- Author:
- adampauls
Nested classes/interfaces inherited from interface java.util.Map |
Map.Entry<K,V> |
Methods inherited from class java.util.AbstractMap |
clear, clone, containsValue, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, toString, values |
NgramsForOrderMapWrapper
public NgramsForOrderMapWrapper(NgramMap<V> map,
WordIndexer<W> wordIndexer,
int ngramOrder)
- Parameters:
map
- ngramOrder
- 0-based, i.e. 0 means unigrams
get
public V get(Object arg0)
- Specified by:
get
in interface Map<List<W>,V>
- Overrides:
get
in class AbstractMap<List<W>,V>
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKey
in interface Map<List<W>,V>
- Overrides:
containsKey
in class AbstractMap<List<W>,V>
entrySet
public Set<Map.Entry<List<W>,V>> entrySet()
- Specified by:
entrySet
in interface Map<List<W>,V>
- Specified by:
entrySet
in class AbstractMap<List<W>,V>