edu.berkeley.nlp.lm
Class WordIndexer.StaticMethods

java.lang.Object
  extended by edu.berkeley.nlp.lm.WordIndexer.StaticMethods
Enclosing interface:
WordIndexer<W>

public static class WordIndexer.StaticMethods
extends Object


Constructor Summary
WordIndexer.StaticMethods()
           
 
Method Summary
static
<W> int[]
toArray(WordIndexer<W> wordIndexer, List<W> list)
          Converts an object representation to an int array.
static
<W> int[]
toArrayFromStrings(WordIndexer<W> wordIndexer, List<String> list)
          Converts an string representation to an int array, adding to the indexer.
static
<W> List<W>
toList(WordIndexer<W> wordIndexer, int[] intNgram)
           
static
<W> List<W>
toList(WordIndexer<W> wordIndexer, int[] intNgram, int startPos, int endPos)
          Converts an int representation of an n-gram to a list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WordIndexer.StaticMethods

public WordIndexer.StaticMethods()
Method Detail

toArray

public static <W> int[] toArray(WordIndexer<W> wordIndexer,
                                List<W> list)
Converts an object representation to an int array. Does not add to the indexer.

Type Parameters:
W -
Parameters:
wordIndexer -
list -
Returns:

toArrayFromStrings

public static <W> int[] toArrayFromStrings(WordIndexer<W> wordIndexer,
                                           List<String> list)
Converts an string representation to an int array, adding to the indexer.

Type Parameters:
W -
Parameters:
wordIndexer -
list -
Returns:

toList

public static <W> List<W> toList(WordIndexer<W> wordIndexer,
                                 int[] intNgram,
                                 int startPos,
                                 int endPos)
Converts an int representation of an n-gram to a list. Converts only the range of the array specified by [startPos,endPos)

Type Parameters:
W -
Parameters:
wordIndexer -
intNgram -
startPos -
endPos -
Returns:

toList

public static <W> List<W> toList(WordIndexer<W> wordIndexer,
                                 int[] intNgram)