am 4d73199c: Merge "Unit test update for I7ed95a54344d8b."
* commit '4d73199c0641ae9daecbadead30d116725a8284c': Unit test update for I7ed95a54344d8b.main
commit
e988434074
|
@ -948,10 +948,13 @@ public class BinaryDictionaryTests extends AndroidTestCase {
|
||||||
final HashSet<String> bigramWord1s = bigrams.get(word0);
|
final HashSet<String> bigramWord1s = bigrams.get(word0);
|
||||||
final WordProperty wordProperty = binaryDictionary.getWordProperty(word0);
|
final WordProperty wordProperty = binaryDictionary.getWordProperty(word0);
|
||||||
assertEquals(bigramWord1s.size(), wordProperty.mBigrams.size());
|
assertEquals(bigramWord1s.size(), wordProperty.mBigrams.size());
|
||||||
|
final int unigramProbability = wordProperty.getProbability();
|
||||||
for (int j = 0; j < wordProperty.mBigrams.size(); j++) {
|
for (int j = 0; j < wordProperty.mBigrams.size(); j++) {
|
||||||
final String word1 = wordProperty.mBigrams.get(j).mWord;
|
final String word1 = wordProperty.mBigrams.get(j).mWord;
|
||||||
assertTrue(bigramWord1s.contains(word1));
|
assertTrue(bigramWord1s.contains(word1));
|
||||||
final int probability = wordProperty.mBigrams.get(j).getProbability();
|
final int bigramProbability = wordProperty.mBigrams.get(j).getProbability();
|
||||||
|
final int probability = binaryDictionary.calculateProbability(
|
||||||
|
unigramProbability, bigramProbability);
|
||||||
assertEquals((int)bigramProbabilities.get(new Pair<String, String>(word0, word1)),
|
assertEquals((int)bigramProbabilities.get(new Pair<String, String>(word0, word1)),
|
||||||
probability);
|
probability);
|
||||||
assertEquals(wordProperty.mBigrams.get(j).getProbability(), probability);
|
assertEquals(wordProperty.mBigrams.get(j).getProbability(), probability);
|
||||||
|
@ -1037,11 +1040,14 @@ public class BinaryDictionaryTests extends AndroidTestCase {
|
||||||
assertEquals((int)wordProbabilitiesToCheckLater.get(word0),
|
assertEquals((int)wordProbabilitiesToCheckLater.get(word0),
|
||||||
wordProperty.mProbabilityInfo.mProbability);
|
wordProperty.mProbabilityInfo.mProbability);
|
||||||
wordSet.remove(word0);
|
wordSet.remove(word0);
|
||||||
|
final int unigramProbability = wordProperty.getProbability();
|
||||||
final HashSet<String> bigramWord1s = bigrams.get(word0);
|
final HashSet<String> bigramWord1s = bigrams.get(word0);
|
||||||
for (int j = 0; j < wordProperty.mBigrams.size(); j++) {
|
for (int j = 0; j < wordProperty.mBigrams.size(); j++) {
|
||||||
final String word1 = wordProperty.mBigrams.get(j).mWord;
|
final String word1 = wordProperty.mBigrams.get(j).mWord;
|
||||||
assertTrue(bigramWord1s.contains(word1));
|
assertTrue(bigramWord1s.contains(word1));
|
||||||
final int probability = wordProperty.mBigrams.get(j).getProbability();
|
final int bigramProbability = wordProperty.mBigrams.get(j).getProbability();
|
||||||
|
final int probability = binaryDictionary.calculateProbability(
|
||||||
|
unigramProbability, bigramProbability);
|
||||||
final Pair<String, String> bigram = new Pair<String, String>(word0, word1);
|
final Pair<String, String> bigram = new Pair<String, String>(word0, word1);
|
||||||
assertEquals((int)bigramProbabilitiesToCheckLater.get(bigram), probability);
|
assertEquals((int)bigramProbabilitiesToCheckLater.get(bigram), probability);
|
||||||
bigramSet.remove(bigram);
|
bigramSet.remove(bigram);
|
||||||
|
|
Loading…
Reference in New Issue