Class WordIndexer.StaticMethods

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

public static class WordIndexer.StaticMethods extends Object
  • Constructor Details

    • StaticMethods

      public StaticMethods()
  • Method Details

    • 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)