am a7805e98
: Add a addOrIncrement term api to DicFacilitator
* commit 'a7805e9870430eac3049129d47bebb312d457477': Add a addOrIncrement term api to DicFacilitator
This commit is contained in:
commit
5bfe1c5697
3 changed files with 20 additions and 1 deletions
|
@ -171,4 +171,10 @@ public interface DictionaryFacilitator {
|
|||
void dumpDictionaryForDebug(final String dictName);
|
||||
|
||||
ArrayList<Pair<String, DictionaryStats>> getStatsOfEnabledSubDicts();
|
||||
|
||||
void addOrIncrementTerm(String fileName,
|
||||
String finalWordToBeAdded,
|
||||
NgramContext ngramContext,
|
||||
int increment,
|
||||
int timeStampInSeconds);
|
||||
}
|
||||
|
|
|
@ -746,10 +746,12 @@ public class DictionaryFacilitatorImpl implements DictionaryFacilitator {
|
|||
return maxFreq;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFrequency(final String word) {
|
||||
return getFrequencyInternal(word, false /* isGettingMaxFrequencyOfExactMatches */);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFrequencyOfExactMatches(final String word) {
|
||||
return getFrequencyInternal(word, true /* isGettingMaxFrequencyOfExactMatches */);
|
||||
}
|
||||
|
@ -793,4 +795,13 @@ public class DictionaryFacilitatorImpl implements DictionaryFacilitator {
|
|||
}
|
||||
return statsOfEnabledSubDicts;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addOrIncrementTerm(String fileName,
|
||||
String word,
|
||||
NgramContext ngramContext,
|
||||
int increment,
|
||||
int timeStampInSeconds) {
|
||||
// Do nothing.
|
||||
}
|
||||
}
|
||||
|
|
|
@ -108,7 +108,9 @@ public class NgramContext {
|
|||
mPrevWordsCount = prevWordsInfo.length;
|
||||
}
|
||||
|
||||
// Create next prevWordsInfo using current prevWordsInfo.
|
||||
/**
|
||||
* Create next prevWordsInfo using current prevWordsInfo.
|
||||
*/
|
||||
@Nonnull
|
||||
public NgramContext getNextNgramContext(final WordInfo wordInfo) {
|
||||
final int nextPrevWordCount = Math.min(
|
||||
|
|
Loading…
Reference in a new issue