am a7805e98: Add a addOrIncrement term api to DicFacilitator

* commit 'a7805e9870430eac3049129d47bebb312d457477':
  Add a addOrIncrement term api to DicFacilitator
main
Jatin Matani 2015-02-10 21:41:29 +00:00 committed by Android Git Automerger
commit 5bfe1c5697
3 changed files with 20 additions and 1 deletions

View File

@ -171,4 +171,10 @@ public interface DictionaryFacilitator {
void dumpDictionaryForDebug(final String dictName); void dumpDictionaryForDebug(final String dictName);
ArrayList<Pair<String, DictionaryStats>> getStatsOfEnabledSubDicts(); ArrayList<Pair<String, DictionaryStats>> getStatsOfEnabledSubDicts();
void addOrIncrementTerm(String fileName,
String finalWordToBeAdded,
NgramContext ngramContext,
int increment,
int timeStampInSeconds);
} }

View File

@ -746,10 +746,12 @@ public class DictionaryFacilitatorImpl implements DictionaryFacilitator {
return maxFreq; return maxFreq;
} }
@Override
public int getFrequency(final String word) { public int getFrequency(final String word) {
return getFrequencyInternal(word, false /* isGettingMaxFrequencyOfExactMatches */); return getFrequencyInternal(word, false /* isGettingMaxFrequencyOfExactMatches */);
} }
@Override
public int getMaxFrequencyOfExactMatches(final String word) { public int getMaxFrequencyOfExactMatches(final String word) {
return getFrequencyInternal(word, true /* isGettingMaxFrequencyOfExactMatches */); return getFrequencyInternal(word, true /* isGettingMaxFrequencyOfExactMatches */);
} }
@ -793,4 +795,13 @@ public class DictionaryFacilitatorImpl implements DictionaryFacilitator {
} }
return statsOfEnabledSubDicts; return statsOfEnabledSubDicts;
} }
@Override
public void addOrIncrementTerm(String fileName,
String word,
NgramContext ngramContext,
int increment,
int timeStampInSeconds) {
// Do nothing.
}
} }

View File

@ -108,7 +108,9 @@ public class NgramContext {
mPrevWordsCount = prevWordsInfo.length; mPrevWordsCount = prevWordsInfo.length;
} }
// Create next prevWordsInfo using current prevWordsInfo. /**
* Create next prevWordsInfo using current prevWordsInfo.
*/
@Nonnull @Nonnull
public NgramContext getNextNgramContext(final WordInfo wordInfo) { public NgramContext getNextNgramContext(final WordInfo wordInfo) {
final int nextPrevWordCount = Math.min( final int nextPrevWordCount = Math.min(