Lines Matching refs:formatVersion
50 private static boolean canCheckBigramProbability(final int formatVersion) {
51 return formatVersion > FormatSpec.VERSION401;
54 private static boolean supportsBeginningOfSentence(final int formatVersion) {
55 return formatVersion > FormatSpec.VERSION401;
59 final int formatVersion) throws IOException {
60 if (formatVersion == FormatSpec.VERSION4
61 || formatVersion == FormatSpec.VERSION4_ONLY_FOR_TESTING
62 || formatVersion == FormatSpec.VERSION4_DEV) {
63 return createEmptyVer4DictionaryAndGetFile(dictId, formatVersion);
65 throw new IOException("Dictionary format version " + formatVersion
71 final int formatVersion) throws IOException {
77 if (BinaryDictionaryUtils.createEmptyDictFile(file.getAbsolutePath(), formatVersion,
82 + " cannot be created. Format version: " + formatVersion);
87 for (final int formatVersion : DICT_FORMAT_VERSIONS) {
88 testIsValidDictionary(formatVersion);
92 private void testIsValidDictionary(final int formatVersion) {
95 dictFile = createEmptyDictionaryAndGetFile("TestBinaryDictionary", formatVersion);
117 for (final int formatVersion : DICT_FORMAT_VERSIONS) {
118 testConstructingDictionaryOnMemory(formatVersion);
122 private void testConstructingDictionaryOnMemory(final int formatVersion) {
125 dictFile = createEmptyDictionaryAndGetFile("TestBinaryDictionary", formatVersion);
132 true /* useFullEditDistance */, Locale.getDefault(), TEST_LOCALE, formatVersion,
135 assertEquals(formatVersion, binaryDictionary.getFormatVersion());
143 assertEquals(formatVersion, binaryDictionary.getFormatVersion());
150 for (final int formatVersion : DICT_FORMAT_VERSIONS) {
151 testAddTooLongWord(formatVersion);
155 private void testAddTooLongWord(final int formatVersion) {
158 dictFile = createEmptyDictionaryAndGetFile("TestBinaryDictionary", formatVersion);
227 for (final int formatVersion : DICT_FORMAT_VERSIONS) {
228 testAddUnigramWord(formatVersion);
232 private void testAddUnigramWord(final int formatVersion) {
235 dictFile = createEmptyDictionaryAndGetFile("TestBinaryDictionary", formatVersion);
271 for (final int formatVersion : DICT_FORMAT_VERSIONS) {
272 testRandomlyAddUnigramWord(formatVersion);
276 private void testRandomlyAddUnigramWord(final int formatVersion) {
283 dictFile = createEmptyDictionaryAndGetFile("TestBinaryDictionary", formatVersion);
309 for (final int formatVersion : DICT_FORMAT_VERSIONS) {
310 testAddBigramWords(formatVersion);
314 private void testAddBigramWords(final int formatVersion) {
317 dictFile = createEmptyDictionaryAndGetFile("TestBinaryDictionary", formatVersion);
340 if (canCheckBigramProbability(formatVersion)) {
348 if (canCheckBigramProbability(formatVersion)) {
371 if (canCheckBigramProbability(formatVersion)) {
378 if (canCheckBigramProbability(formatVersion)) {
387 for (final int formatVersion : DICT_FORMAT_VERSIONS) {
388 testRandomlyAddBigramWords(formatVersion);
392 private void testRandomlyAddBigramWords(final int formatVersion) {
401 dictFile = createEmptyDictionaryAndGetFile("TestBinaryDictionary", formatVersion);
442 if (canCheckBigramProbability(formatVersion)) {
452 for (final int formatVersion : DICT_FORMAT_VERSIONS) {
453 testRemoveBigramWords(formatVersion);
457 private void testRemoveBigramWords(final int formatVersion) {
460 dictFile = createEmptyDictionaryAndGetFile("TestBinaryDictionary", formatVersion);
504 for (final int formatVersion : DICT_FORMAT_VERSIONS) {
505 testFlushDictionary(formatVersion);
509 private void testFlushDictionary(final int formatVersion) {
512 dictFile = createEmptyDictionaryAndGetFile("TestBinaryDictionary", formatVersion);
558 for (final int formatVersion : DICT_FORMAT_VERSIONS) {
559 testFlushWithGCDictionary(formatVersion);
563 private void testFlushWithGCDictionary(final int formatVersion) {
566 dictFile = createEmptyDictionaryAndGetFile("TestBinaryDictionary", formatVersion);
592 if (canCheckBigramProbability(formatVersion)) {
608 for (final int formatVersion : DICT_FORMAT_VERSIONS) {
609 testAddBigramWordsAndFlashWithGC(formatVersion);
614 private void testAddBigramWordsAndFlashWithGC(final int formatVersion) {
623 dictFile = createEmptyDictionaryAndGetFile("TestBinaryDictionary", formatVersion);
672 if (canCheckBigramProbability(formatVersion)) {
682 for (final int formatVersion : DICT_FORMAT_VERSIONS) {
683 testRandomOperationsAndFlashWithGC(formatVersion);
687 private void testRandomOperationsAndFlashWithGC(final int formatVersion) {
701 dictFile = createEmptyDictionaryAndGetFile("TestBinaryDictionary", formatVersion);
784 if (canCheckBigramProbability(formatVersion)) {
799 for (final int formatVersion : DICT_FORMAT_VERSIONS) {
800 testAddManyUnigramsAndFlushWithGC(formatVersion);
804 private void testAddManyUnigramsAndFlushWithGC(final int formatVersion) {
813 dictFile = createEmptyDictionaryAndGetFile("TestBinaryDictionary", formatVersion);
849 for (final int formatVersion : DICT_FORMAT_VERSIONS) {
850 testUnigramAndBigramCount(formatVersion);
854 private void testUnigramAndBigramCount(final int formatVersion) {
864 dictFile = createEmptyDictionaryAndGetFile("TestBinaryDictionary", formatVersion);
910 for (final int formatVersion : DICT_FORMAT_VERSIONS) {
911 testAddMultipleDictionaryEntries(formatVersion);
915 private void testAddMultipleDictionaryEntries(final int formatVersion) {
924 dictFile = createEmptyDictionaryAndGetFile("TestBinaryDictionary", formatVersion);
967 if (canCheckBigramProbability(formatVersion)) {
975 for (final int formatVersion : DICT_FORMAT_VERSIONS) {
976 testGetWordProperties(formatVersion);
980 private void testGetWordProperties(final int formatVersion) {
990 dictFile = createEmptyDictionaryAndGetFile("TestBinaryDictionary", formatVersion);
1069 if (canCheckBigramProbability(formatVersion)) {
1078 for (final int formatVersion : DICT_FORMAT_VERSIONS) {
1079 testIterateAllWords(formatVersion);
1083 private void testIterateAllWords(final int formatVersion) {
1093 dictFile = createEmptyDictionaryAndGetFile("TestBinaryDictionary", formatVersion);
1162 if (canCheckBigramProbability(formatVersion)) {
1175 for (final int formatVersion : DICT_FORMAT_VERSIONS) {
1176 testAddShortcuts(formatVersion);
1180 private void testAddShortcuts(final int formatVersion) {
1183 dictFile = createEmptyDictionaryAndGetFile("TestBinaryDictionary", formatVersion);
1241 for (final int formatVersion : DICT_FORMAT_VERSIONS) {
1242 testAddManyShortcuts(formatVersion);
1246 private void testAddManyShortcuts(final int formatVersion) {
1260 dictFile = createEmptyDictionaryAndGetFile("TestBinaryDictionary", formatVersion);
1318 for (final int formatVersion : DICT_FORMAT_VERSIONS) {
1319 testDictMigration(FormatSpec.VERSION4_ONLY_FOR_TESTING, formatVersion);
1373 for (final int formatVersion : DICT_FORMAT_VERSIONS) {
1374 testLargeDictMigration(FormatSpec.VERSION4_ONLY_FOR_TESTING, formatVersion);
1451 for (final int formatVersion : DICT_FORMAT_VERSIONS) {
1452 if (supportsBeginningOfSentence(formatVersion)) {
1453 testBeginningOfSentence(formatVersion);
1458 private void testBeginningOfSentence(final int formatVersion) {
1461 dictFile = createEmptyDictionaryAndGetFile("TestBinaryDictionary", formatVersion);
1489 for (final int formatVersion : DICT_FORMAT_VERSIONS) {
1490 testGetMaxFrequencyOfExactMatches(formatVersion);
1494 private void testGetMaxFrequencyOfExactMatches(final int formatVersion) {
1497 dictFile = createEmptyDictionaryAndGetFile("TestBinaryDictionary", formatVersion);