public class BerkeleyLmProvider extends Object implements FrequencyCountProvider
| Constructor and Description |
|---|
BerkeleyLmProvider(String binaryFile,
String language) |
| Modifier and Type | Method and Description |
|---|---|
long |
getFrequency(String phrase)
Get frequency for a phrase
|
String |
getID()
Returns an ID that identifies the frequency provider
|
String |
getLanguage()
Returns the language for which the frequencies are provided.
|
double |
getLogProbability(String phrase)
Get the log probability for a phrase
|
Iterator<String> |
getNgramIterator(int n)
Returns an iterator over all ngrams of a given size in the corpus.
|
long |
getNrOfDistinctNgrams(int n)
Returns the number of distinct ngrams of a given size in the corpus.
|
long |
getNrOfNgrams(int n)
Returns the number of ngrams of a given size in the corpus.
|
long |
getNrOfTokens() |
double |
getProbability(String phrase)
Get the probability (=normalized frequency) for a phrase.
The frequency count is normalized by the number of phrases in the corpus. |
public long getFrequency(String phrase)
FrequencyCountProvidergetFrequency in interface FrequencyCountProviderphrase - phrase to searchpublic double getProbability(String phrase)
FrequencyCountProvidergetProbability in interface FrequencyCountProviderphrase - phrase to searchpublic double getLogProbability(String phrase)
FrequencyCountProvidergetLogProbability in interface FrequencyCountProviderphrase - phrase to searchpublic long getNrOfTokens()
getNrOfTokens in interface FrequencyCountProviderpublic long getNrOfNgrams(int n)
FrequencyCountProvidergetNrOfNgrams in interface FrequencyCountProvidern - the ngram size.public long getNrOfDistinctNgrams(int n)
FrequencyCountProvidergetNrOfDistinctNgrams in interface FrequencyCountProvidern - the ngram size.public Iterator<String> getNgramIterator(int n)
FrequencyCountProvidergetNgramIterator in interface FrequencyCountProvidern - the ngram size.public String getLanguage()
FrequencyCountProvidergetLanguage in interface FrequencyCountProviderpublic String getID()
FrequencyCountProvidergetID in interface FrequencyCountProviderCopyright © 2007–2019 Ubiquitous Knowledge Processing (UKP) Lab, Technische Universität Darmstadt. All rights reserved.