Class NgramsForOrderIterableWrapper<W,V>
java.lang.Object
edu.berkeley.nlp.lm.map.NgramsForOrderIterableWrapper<W,V>
- Type Parameters:
W-V-
public class NgramsForOrderIterableWrapper<W,V>
extends Object
implements Iterable<Map.Entry<List<W>,V>>
Wraps an NgramMap as an Iterable, so it is easy to iterate over the n-grams
of a particular order. Using this interface is a little inefficient due to
the boxing and temporary object allocation necessary to conform to Java's
interfaces.
- Author:
- adampauls
-
Constructor Summary
ConstructorsConstructorDescriptionNgramsForOrderIterableWrapper(NgramMap<V> map, WordIndexer<W> wordIndexer, int ngramOrder) -
Method Summary
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
NgramsForOrderIterableWrapper
- Parameters:
map-ngramOrder- 0-based, i.e. 0 means unigrams
-
-
Method Details
-
iterator
-
size
public long size()
-