Class WordpieceEncoder.VocabularyTrie

java.lang.Object
opennlp.tools.tokenize.WordpieceEncoder.VocabularyTrie
Enclosing class:
WordpieceEncoder

private static final class WordpieceEncoder.VocabularyTrie extends Object
Finds vocabulary entries without creating strings for candidate lengths.
  • Field Details

  • Constructor Details

    • VocabularyTrie

      private VocabularyTrie(Map<String,Integer> vocabulary, boolean continuation)
      Indexes the initial or the continuation pieces of a vocabulary.
      Parameters:
      vocabulary - The piece-to-id mapping.
      continuation - true to index pieces starting with the continuation prefix, stored without it; false to index all other pieces.
  • Method Details