@Test public void testVocabulary() throws IOException { SmoothLm lm = getTinyLm(); LmVocabulary vocab = lm.getVocabulary(); Assert.assertTrue(vocab.contains("Ahmet")); int i1 = vocab.indexOf("Ahmet"); Assert.assertTrue(vocab.contains("elma")); int i2 = vocab.indexOf("elma"); Assert.assertTrue(i1 != i2); Assert.assertEquals("Ahmet", vocab.getWord(i1)); Assert.assertEquals("elma", vocab.getWord(i2)); }
@Override public LmVocabulary getVocabulary() { return vocabulary; }
SmoothLm extends BaseLanguageModel implements NgramLanguageModel { @Override public LmVocabulary getVocabulary() { return vocabulary; } }
SmoothLm extends BaseLanguageModel implements NgramLanguageModel { @Override public LmVocabulary getVocabulary() { return vocabulary; } private  SmoothLm(
      DataInputStream dis,
      float logBase,
      float unigramWeight,
      float unknownBackoffPenalty,
      boolean useStupidBackoff,
      float stupidBackoffAlpha,
      File ngramKeyFileDir); private  SmoothLm(DataInputStream dis); }
SmoothLm extends BaseLanguageModel implements NgramLanguageModel { @Override public LmVocabulary getVocabulary() { return vocabulary; } private  SmoothLm(
      DataInputStream dis,
      float logBase,
      float unigramWeight,
      float unknownBackoffPenalty,
      boolean useStupidBackoff,
      float stupidBackoffAlpha,
      File ngramKeyFileDir); private  SmoothLm(DataInputStream dis); static Builder builder(InputStream is); static Builder builder(File modelFile); static Builder builder(Path modelFile); String info(); double getStupidBackoffLogAlpha(); int getVersion(); @Override float getUnigramProbability(int id); @Override int getOrder(); @Override LmVocabulary getVocabulary(); LookupCache getCache(); LookupCache getCache(int bits); int getGramCount(int n); @Override boolean ngramExists(int... wordIndexes); double getProbabilityValue(int... wordIndexes); float getBigramProbabilityValue(int w0, int w1); double getBackoffValue(int... wordIndexes); float getBigramBackoffValue(int w0, int w1); double getProbability(String... words); void countFalsePositives(int... wordIndexes); boolean ngramIdsAvailable(); int getFalsePositiveCount(); float getProbability(int... wordIndexes); float getBigramProbability(int w0, int w1); float getTriGramProbability(int w0, int w1, int w2); float getTriGramProbability(int w0, int w1, int w2, int fingerPrint); float getTriGramProbability(int... w); int getBackoffCount(String... tokens); int getBackoffCount(int... wordIndexes); String explain(int... wordIndexes); double getLogBase(); }
SmoothLm extends BaseLanguageModel implements NgramLanguageModel { @Override public LmVocabulary getVocabulary() { return vocabulary; } private  SmoothLm(
      DataInputStream dis,
      float logBase,
      float unigramWeight,
      float unknownBackoffPenalty,
      boolean useStupidBackoff,
      float stupidBackoffAlpha,
      File ngramKeyFileDir); private  SmoothLm(DataInputStream dis); static Builder builder(InputStream is); static Builder builder(File modelFile); static Builder builder(Path modelFile); String info(); double getStupidBackoffLogAlpha(); int getVersion(); @Override float getUnigramProbability(int id); @Override int getOrder(); @Override LmVocabulary getVocabulary(); LookupCache getCache(); LookupCache getCache(int bits); int getGramCount(int n); @Override boolean ngramExists(int... wordIndexes); double getProbabilityValue(int... wordIndexes); float getBigramProbabilityValue(int w0, int w1); double getBackoffValue(int... wordIndexes); float getBigramBackoffValue(int w0, int w1); double getProbability(String... words); void countFalsePositives(int... wordIndexes); boolean ngramIdsAvailable(); int getFalsePositiveCount(); float getProbability(int... wordIndexes); float getBigramProbability(int w0, int w1); float getTriGramProbability(int w0, int w1, int w2); float getTriGramProbability(int w0, int w1, int w2, int fingerPrint); float getTriGramProbability(int... w); int getBackoffCount(String... tokens); int getBackoffCount(int... wordIndexes); String explain(int... wordIndexes); double getLogBase(); static final float DEFAULT_LOG_BASE; static final float DEFAULT_UNIGRAM_WEIGHT; static final float DEFAULT_UNKNOWN_BACKOFF_PENALTY; static final float DEFAULT_STUPID_BACKOFF_ALPHA; static final int DEFAULT_UNKNOWN_TOKEN_PROBABILITY; }