Commit Graph

735 Commits (847735fdfacfda3fda0e3a1370a35896832cb8bb)

Author SHA1 Message Date
Jean Chalard b8d764772b Add the input style to SuggestedWords.
Change-Id: I81f37d08659d449822b027d3d5912e11eec8b8ff
2014-08-14 17:53:04 +09:00
Keisuke Kuroyanagi caee2c1876 Print files when dict file existence check is failed.
Change-Id: Id71f239afa95b68961192714998695c21ed48002
2014-08-13 15:51:34 +09:00
Keisuke Kuroyanagi 7185f30a5c Remove all test dictionary files before and after unit test.
Change-Id: I92db6318daa98684639ab959f55d047a941fe265
2014-08-13 15:51:16 +09:00
Keisuke Kuroyanagi 9f584e15eb Add additional wait for writing file in testAddManyWords().
Change-Id: Ibb79b9821dac3d48e18c684e8aca605254bec045
2014-08-12 22:29:02 +09:00
Keisuke Kuroyanagi e05eb21826 Rename distracter filter class.
Bug: 13142176
Bug: 15531638
Change-Id: I89cef5264073eed25ffb5be10fdff731df0a3138
2014-08-08 17:01:19 +09:00
Keisuke Kuroyanagi 33ca0c80c1 Use suggestions in the distracter filter.
Bug: 13142176
Bug: 15531638

Change-Id: I609fa61fccf2a0c738726985806b7d9248eadf49
2014-08-08 17:01:16 +09:00
Ken Wakasa 3316dcd453 Merge "Revert "Introduce onEvent() to improve testability"" into lmp-dev 2014-08-05 00:07:36 +00:00
Ken Wakasa f5f5fb4b64 Revert "Introduce onEvent() to improve testability"
This reverts commit ef74e737f5.

Apparently, this CL broke several unit tests.

Change-Id: I86cf5f1ffb0214707afe99ee97f92ba8c5157f3f
2014-08-06 23:57:03 +00:00
Jean Chalard ef74e737f5 Introduce onEvent() to improve testability
...and prepare for the future

Change-Id: Ieed96ab552993fd148e80b9c3355f1b569bd716f
2014-08-06 07:29:35 +00:00
Jean Chalard 93daa04d60 Deactivate tests for Myanmar
They are pretty extensive already and require an implementation
that works pretty well. However ours is based on an old architecture
and updating them will take time, so for the time being it's best
to just deactivate the tests.

Change-Id: I649a220d13fc455b4306706bb964602c27a5a28c
2014-08-06 16:42:30 +09:00
Akifumi Yoshimoto c21619fe73 Make dict log cleanup.
Delete unneeded output when creating a dictionary

Change-Id: If7dc5dc74a53d0054967cb801e5ccfdd53ebe179
2014-08-06 15:32:18 +09:00
Tadashi G. Takaoka ab661e3ef8 Make "Show correction suggestions" as a binary option
Formerly "Show correction suggestions" had three options, "always
show", "show in portrait mode", and "always hide". The reason behind
"show in portrait mode" was that there may not be enough screen estate
in landscape mode to show suggestions. Because recent phone devices
have relatively large screen, we decide to remove "show in portrait
mode" option.

Bug: 15780939
Change-Id: I896d737452c3893d43ce20bd88127f10c1eb3d83
2014-07-27 14:47:07 +09:00
Yohei Yukawa eac8670830 Enable StringUtils to split CharSequence like String#split
This is a groundwork for enabling LocaleSpan.

To enable LocaleSpan everywhere, we need to switch to
CharSequence from String so that Span infromation can be
preserved end-to-end.  To achieve this, we need to have
CharSequence version of String#split.

BUG: 16029304
Change-Id: I0dd103185dcf62fb1e25054a374340790e6a4678
2014-07-19 22:47:56 +09:00
Ken Wakasa e645715b25 Clean up under the util package.
- Move util classes that are unused in AOSP
- Remove unused methods

Change-Id: Ic97fd313f1e2bafd50609d42aa3a2d090b63eafc
2014-07-18 17:47:14 +09:00
Keisuke Kuroyanagi bb843eb223 Move getPrevWordsInfoFromNthPreviousWord to PrevWordsInfoUtils.
Bug: 14425059
Change-Id: Id37022ac6c1545d6845abfbcdb7ed47f0e250eec
2014-07-07 13:07:57 +09:00
Yohei Yukawa 73065b778c Remove dead code to fix test failure due to NoSuchMethodError
This CL removes following methods from StringUtils, which are
no longer used since Id3c262386a7bc7ed75966b1395a50171abe550d3.
- #joinCommaSplittableText
- #appendToCommaSplittableTextIfNotExists

BUG: 16000850
Change-Id: Ibdc9b7e463a19cdfac788b24c0a6322d0c5850c5
2014-07-04 19:12:14 +09:00
Yohei Yukawa 3895d7f8dc Additional subtype ID should be independent of OS-version
This CL consolidates the initialization logic for additional
subtypes so that each additional subtypes can have predictable
subtype ID regardless of OS version.

Previously subtype IDs for additional subtypes are calculated
differently depending on the running OS version with hoping it
minimizes the risk of compatibility issues.  However, it is
getting harder and harder to maintain slightly different
logic between OSes. Thus we decided to unify the logic into
that in KitKat even though it may causes some breaking changes.

Note that the actual extra values that are used to instantiate
InputMethodSubtype object are still determined on the fly
depending on the running OS version. However these actual
extra values are no longer used for the subtype ID calculation.

BUG: 16000850
Change-Id: Id3c262386a7bc7ed75966b1395a50171abe550d3
2014-07-04 15:08:58 +09:00
Jean Chalard e063e1b218 Merge "Fix a unit test" 2014-06-26 23:14:30 +00:00
Jean Chalard fa4c59f9b6 Fix a unit test
When switching languages, we need to wait until the dictionary is
loaded to compute suggestions.

Change-Id: I7c32a900b297cd6302bfdc020842581315f3007f
2014-07-01 18:19:11 +09:00
Jean Chalard 292deb632c [SD7] Actually check for script.
...also implement the check for Hebrew and Arabic.

Bug: 15840116
Change-Id: Ia6433d7d98038ade64c171be4fe4b3f094111fac
2014-07-01 15:01:22 +09:00
Jean Chalard 20c89b1cf5 [SD5(2)] Remove useless args
Bug: 15840116
Change-Id: I1123426fbd9d420c1be64ccc917a5f870e70e6fa
2014-07-01 13:34:25 +09:00
Jean Chalard 3fb5a541a4 Fix tests
Change-Id: I12ba56d021b50c03dc62e3f3c8db3ecada2f6a4b
2014-06-30 15:25:31 +09:00
Ken Wakasa 4569a734ad Revert "Move getPrevWordsInfoFromNthPreviousWord to StringUtlis."
This reverts commit ba463c9a66 that broke the dicttool build.

Bug: 14425059
Change-Id: Ie1685587104d26e4416624747c97f6087c13388a
2014-06-27 15:07:07 +00:00
Keisuke Kuroyanagi ba463c9a66 Move getPrevWordsInfoFromNthPreviousWord to StringUtlis.
Bug: 14425059
Change-Id: I3eb24e840c165e43f68c2a60fccf9974affb57a6
2014-06-27 18:08:17 +09:00
Keisuke Kuroyanagi 1c2f1ada83 Find multiple previous word information to support n-gram.
Bug: 14425059

Change-Id: Ieace636334a9b2a094527341d4fcfc05958296c5
2014-06-27 17:59:21 +09:00
Keisuke Kuroyanagi 92827b0712 Merge "Make PrevWordsInfo have multiple words' information." 2014-06-24 01:52:26 +00:00
Keisuke Kuroyanagi e708b1bc2e Make PrevWordsInfo have multiple words' information.
Bug: 14425059
Change-Id: I2bd6a872904a44b80f638a13d91a97559217cc1a
2014-06-25 14:14:37 +09:00
Keisuke Kuroyanagi 0aef59746c Make Beginning-of-Sentence prediction require two exposures.
Bug: 15868192
Change-Id: I4b577ad11c992d872d6f902fd50527d9ca5cc1ba
2014-06-25 20:20:44 +09:00
Keisuke Kuroyanagi 52cef13211 Fix: unit tests by clearing personalized dicts
Bug: 14119293
Change-Id: I61cc05fb09342103f453ba83709c6be68d2f695e
2014-06-25 11:40:29 +09:00
Keisuke Kuroyanagi 702e153fbc Merge "Support migration/dump of Beginning-of-Sentence entries." 2014-06-24 01:59:00 +00:00
Keisuke Kuroyanagi 88fa47a27d Support migration/dump of Beginning-of-Sentence entries.
Bug: 14119293
Change-Id: Ie975138f819794d5c34a7a547be5a6117050e084
2014-06-24 12:37:07 +09:00
Jean Chalard bfea7dec1a Add a test for Armenian periods.
Bug: 11463389
Change-Id: Ic1a612bd6b2693369a1688e6a2273cff26fbe6d1
2014-06-18 17:45:53 +09:00
Keisuke Kuroyanagi 17f03583c8 Merge "Add a method to update contextual dictionary." 2014-06-10 22:31:57 +00:00
Keisuke Kuroyanagi 356539699a Add a method to update contextual dictionary.
Bug: 14161647
Change-Id: I2111f841c94e31d62b670da4236fc738df03a708
2014-06-16 17:00:12 +09:00
Keisuke Kuroyanagi e041bfab5c Update unit test for beginning-of-sentence.
Bug: 14119293
Change-Id: I594a1ca1096f0c12c678dd30eb75de905e55c5bb
2014-06-12 16:07:39 +09:00
Jean Chalard 4863a06544 Special case periods in the spell checker
Special case <valid word>.<valid word> to send as a suggestion
the same string where the periods is replaced by a space.

Bug: 10780091
Change-Id: I43c94675977f9ab5d7ee5671486cb742b39f3974
2014-06-10 19:52:58 +09:00
Jean Chalard e689d37f72 Remove a useless method
Change-Id: I21a4219f682f43f4a84b1ab12d00dd930b35caa1
2014-06-10 12:47:55 +09:00
Jean Chalard 367c199de1 Remove mPrevWordsInfo
This member has outlived its usefulness. It's not clear now that it
makes things really faster, but it does bring a lot of complexity
that we can avoid by removing it.

Change-Id: Ifbc8094a45b56b958fe165b1930f4cc358a97721
2014-06-10 12:07:51 +09:00
Keisuke Kuroyanagi bdf745da32 Check isInDictionary() before the distracter test.
Bug: 13142176
Bug: 15428247
Change-Id: I7ce2c09ebbef6ca8c056807c2a35f2f987fd436e
2014-06-09 11:43:45 +09:00
Keisuke Kuroyanagi 1910392eed Add Dictionary.isInDictionary().
Bug: 13142176
Bug: 15428247
Change-Id: If2d1c1fea7a69e41809a828da8dd032211ad144e
2014-06-09 11:04:28 +09:00
Keisuke Kuroyanagi 166d8c2293 Make Distracter filter use getMaxFrequencyOfExactMatches().
Bug: 13142176
Bug: 15428247

Change-Id: I5c23fbea2851f891f76f19d9da2cb70ae964569b
2014-06-06 19:38:44 +09:00
Keisuke Kuroyanagi d9b8602f48 Implement getMaxProbabilityOfExactMatches().
Bug: 13142176
Bug: 15428247
Change-Id: I5be6d683be95505412615ca7c88260de1ea05f54
2014-06-06 17:37:46 +09:00
Jean Chalard 4a1113b6b0 Refactoring
Rename `initialize' to `start' and `deactivate' to `stop' for ease
of understanding. It's completely bizarre that you can "deactivate"
a recapitalization and that will just restart a new one the next time
you press shift. Start and stop are easier to understand.

Change-Id: I455175aebfcfe11198c6c61bf2c6b19efc3f82df
2014-06-04 16:29:29 +09:00
Keisuke Kuroyanagi 8f71fab2ed Make prevWord = null if the next word starts from a connector.
This fixes PunctuationTests#
testAutoCorrectionWithSingleQuotesAround.

Bug: 14119293
Bug: 15334309

Change-Id: I604c21a21e89a5fc431fd56ab7b6ad03f4736b01
2014-05-30 20:30:17 +09:00
Jean Chalard d0d3d813d2 Fix tests
DEBUG in LatinIME has been changed by Ie52007dc to mean both
DebugSettings.PREF_DEBUG_MODE and Settings.PREF_KEY_IS_INTERNAL
instead of just DEBUG_MODE as used to be the case. Tests depend
on the debug mode to test many things and they make sure they run
in debug mode or they fail. This has tests understand the change in
policy.

Change-Id: Ie9f29e6a1d85e19704c8940d3fcf97c13c3dbaa6
2014-05-29 22:15:56 +09:00
Keisuke Kuroyanagi c4a3b9f0d6 Merge "Remove PrioritizedSerialExecutor." 2014-05-29 08:52:23 +00:00
Jean Chalard 944923f266 Fix: too many calls to getSuggestedWordsForTypingInput
This reverts commit d941ea18 and builds on it to fix the behavior
of the broken cases.
It also fixes a small, related bug that probably has existed for
a very long time: predictions not displayed when cancelling
double-space-to-period.

Bug: 15148015
Change-Id: I1f9358f8b6f5804f831643611576be347e83999d
2014-05-29 17:36:46 +09:00
Keisuke Kuroyanagi 94f88b4881 Remove PrioritizedSerialExecutor.
Bug: 15320560
Change-Id: Icb88a96ebd685da1d2cba7b07889a2751c603a2e
2014-05-29 17:36:32 +09:00
Keisuke Kuroyanagi b9a3775203 Merge "Add PersonalizationDictionaryTests." 2014-05-29 07:37:47 +00:00
Keisuke Kuroyanagi 8d0a0d1f3e Add PersonalizationDictionaryTests.
Bug: 11778342
Change-Id: Ice88f439ae11714e5ec9dd3b7616d0c2d59ea812
2014-05-29 16:33:21 +09:00
Jean Chalard 2381b8cfdc Disable a test that fails for an unknown reason
It works when tested on the actual device, and on some versions
of the platform. Until we know what's wrong with resource loading
when running under the test harness, we need to disable this test.

Change-Id: I2d7ed9db940b9b73739de8325665bdafb6af58cb
2014-05-29 14:02:44 +09:00
Keisuke Kuroyanagi b1e43d58a6 Merge "Stop directly checking SuggestedWordInfo.mKind" 2014-05-28 11:52:00 +00:00
Keisuke Kuroyanagi 4bffac6db9 Stop directly checking SuggestedWordInfo.mKind
Bug: 15298959

Change-Id: Iba6eeb7981634e7ddb896404978b30f6efd6e72f
2014-05-28 20:35:45 +09:00
Jean Chalard fa69784a96 Run test only on KitKat devices
This won't work on < KK because it needs the armenian locale
to be present on the device. I don't know why, but when under
test, apps don't seem to be able to resolve resources for locales
not supported by the system.

Change-Id: Ie0f4fc30954978061cae751024bab5569a2ab2eb
2014-05-28 17:45:28 +09:00
Keisuke Kuroyanagi 3faf4fc5e7 Merge "Return whether the dynamic dict operation was success." 2014-05-27 09:01:46 +00:00
Keisuke Kuroyanagi dfca51726e Return whether the dynamic dict operation was success.
Bug: 12184250
Change-Id: Iee7e00c1e84c95551a077f4dd023c0a9b9ac9466
2014-05-27 17:30:00 +09:00
Keisuke Kuroyanagi 301eeaa976 Fix unit test build.
Change-Id: Id2c92c5035d7b357fa66c7ca671b72a1a33ebf3b
2014-05-27 16:43:11 +09:00
Keisuke Kuroyanagi 00da83ed75 Stop filtering out when perfect freq > top non-perfect freq.
Bug: 13142176
Change-Id: I0290df918a5bd5018bf55231dc462d5e797155c6
2014-05-27 16:09:59 +09:00
Keisuke Kuroyanagi 17bd4eb0c9 Apply distracter filter for UserHistoryDictionary.
Bug: 13142176
Change-Id: I67d63a5c789d7c587bcd7abacd26b2e76da11978
2014-05-27 01:10:04 +09:00
Keisuke Kuroyanagi a6278eb9c1 Use whether it's exact match to detect distracters.
Bug: 13142176
Change-Id: Id5b7286d28897931f7bfe571be45d46ffeef4adf
2014-05-26 21:56:20 +09:00
Tadashi G. Takaoka a91561aa58 Use Java 7 diamond operator
Change-Id: If16ef50ae73147594615d0f49d6a22621eaf1aef
2014-05-24 01:05:42 +09:00
Keisuke Kuroyanagi e782f1f415 Merge "Update RichInputConnectionAndTextRangeTests." 2014-05-23 14:53:29 +00:00
Keisuke Kuroyanagi 9f9988e996 Merge "Introduce EMPTY_PREV_WORDS_INFO and BEGINNING_OF_SENTENCE." 2014-05-23 14:53:13 +00:00
Keisuke Kuroyanagi f2c2657566 Update RichInputConnectionAndTextRangeTests.
Bug: 14119293
Change-Id: I952daaa8e938c67bd9e0e699d71a77a3b0bf8b0d
2014-05-23 23:19:35 +09:00
Keisuke Kuroyanagi a790c5b683 Introduce EMPTY_PREV_WORDS_INFO and BEGINNING_OF_SENTENCE.
Bug: 14119293
Change-Id: I5020e5f0aa64bc3e97b3a3c2c07a60c8b765ed64
2014-05-23 23:19:33 +09:00
Keisuke Kuroyanagi a37f374ad1 Version up dynamic dict format from 401 to 402.
Change-Id: Ibea36af905ade773ae3db3a5456f7b5a0ad7d220
2014-05-23 20:20:56 +09:00
Keisuke Kuroyanagi 1adca93381 Extend jni methods and enable Beginning-of-Sentence.
Bug: 14119293
Change-Id: I78fc877367dd0d6240eeacb750b6d2d0b93cba83
2014-05-23 19:58:58 +09:00
Jean Chalard 47ea762fb2 Add a test for armenian period.
Bug: 11463389
Change-Id: Ib482290672947df61b86cdb4e78461e9ce843f94
2014-05-23 19:35:43 +09:00
Keisuke Kuroyanagi 85befc0873 Merge "Make DistracterFilter interface." 2014-05-23 10:11:57 +00:00
Jean Chalard cfdb1b8d26 Fix some auto-caps problems:
- (mainly for Spanish) auto-caps after inverted bang and what
- (German only) don't auto-cap after digits-period-space

Bug: 15177663
Bug: 12206753
Change-Id: Ia214bc067319469d9debbbfbdcb1dcff980847f0
2014-05-23 18:17:09 +09:00
Keisuke Kuroyanagi f498e53933 Make DistracterFilter interface.
Bug: 13142176
Bug: 15094186
Change-Id: If94b0a155b5ea2ff6b839e7da9d12a9cc6553931
2014-05-23 18:12:37 +09:00
Keisuke Kuroyanagi 1fa3e9044f Move distracter filter to dictionary facilitator.
Bug: 13142176
Bug: 15094186
Change-Id: Ib9e42f8e25538009f3ba62cf1e034cae3f6823c7
2014-05-23 16:10:36 +09:00
Keisuke Kuroyanagi 17f326b745 Add beginning of sentence information in PrevWordsInfo.
Bug: 14119293
Bug: 14425059
Change-Id: I65320920e840082b0b697bb621676716d0933e0c
2014-05-21 15:40:08 +09:00
Keisuke Kuroyanagi e507d92aa3 Use PrevWordsInfo for get/add/remove n-gram(bigram) entry.
Bug: 14119293
Bug: 14425059
Bug: 15102610
Change-Id: Ib482390f8d15b37d44a1a54e8c243a9eaec3f815
2014-05-21 11:15:38 +09:00
Ken Wakasa 4e21d3711f Revert "Use PrevWordsInfo for get/add/remove n-gram(bigram) entry."
This reverts commit ff50b39176.

Bug: 14119293
Bug: 14425059
Bug: 15102610

Change-Id: If278b4ab236e38d20d8cdc0761b0438911bd4ff9
2014-05-20 14:01:06 +00:00
Keisuke Kuroyanagi ff50b39176 Use PrevWordsInfo for get/add/remove n-gram(bigram) entry.
Bug: 14119293
Bug: 14425059

Change-Id: I12e9ba977c153b514c6591ab52940712fd0874e3
2014-05-20 13:37:04 +09:00
Keisuke Kuroyanagi 83c40a2301 Use PrevWordsInfo instead of String in Java side.
Bug: 14119293
Bug: 14425059

Change-Id: I3d5da84881a49a04550180dd9aac2c37da2ed762
2014-05-19 13:55:40 +09:00
Keisuke Kuroyanagi 23246ed18d Use dedicated DictionaryFacilitator for DistracterFilter
Bug: 15002249
Change-Id: Ic77eaa7d627d406daad7dcd15cb4884d9f647312
2014-05-17 01:18:08 +09:00
Keisuke Kuroyanagi 34873a66f0 Fix: StringIndexOutOfBoundsException.
Bug: 14985751
Change-Id: I9df2f737555ab02e24e0fbd231a97c1eec26bc57
2014-05-16 15:32:12 +09:00
Keisuke Kuroyanagi e810a266fd Merge "Quit use bigram probability diff for ver4 dict." 2014-05-15 07:07:25 +00:00
Keisuke Kuroyanagi 64341927d2 Quit use bigram probability diff for ver4 dict.
Change-Id: I2cfcfbcf351877d1dff466a24974dbb05908f14e
2014-05-15 16:02:58 +09:00
Keisuke Kuroyanagi aa7329de15 Merge "Add VERSION4_DEV(402) in Java side and use it for tests." 2014-05-14 13:42:24 +00:00
Keisuke Kuroyanagi 04536f14b0 Add VERSION4_DEV(402) in Java side and use it for tests.
Bug: 13406708
Change-Id: I7c9c53bf34d12dced7331a359a83f6444490783a
2014-05-14 22:37:07 +09:00
Jean Chalard 5ce39dfa78 Fix a bug where changing languages kills the composition.
Bug: 14926896
Change-Id: Id2a06c68a51f833db4d8bbc858a232c2696afb6e
2014-05-14 20:34:32 +09:00
Jean Chalard 4b6660f8f9 Merge "Fix unit tests." 2014-05-14 07:18:56 +00:00
Jean Chalard 68730d1c8e Fix unit tests.
Language change has always been strange. That's because we
didn't call the right method >.>
Also, extra values were not passed in correctly.

Change-Id: Ifc345988df944ad691fe22cb71cb519e47a5a223
2014-05-14 16:09:40 +09:00
Xiaojun Bi 25ec32f635 Merge "Implement the distracter filter" 2014-05-13 23:08:40 +00:00
Xiaojun Bi ac20253806 Implement the distracter filter
Bug: 13142176

Change-Id: I85a048cdcbbad3d6020a25f900250d8d7a0fe3da
2014-05-13 15:52:14 -07:00
Keisuke Kuroyanagi 5c154edb55 Merge "Add large unit test for dictionary migration." 2014-05-13 06:40:28 +00:00
Keisuke Kuroyanagi 3c7f140e8e Add large unit test for dictionary migration.
Bug: 13406708
Change-Id: Ic1eb627139a1ff57c0000d95d9bd57aa3609f753
2014-05-13 15:16:30 +09:00
Keisuke Kuroyanagi 61fc329901 Merge "Support bigram historical information migration." 2014-05-13 02:56:36 +00:00
Keisuke Kuroyanagi 620a05ae59 Support bigram historical information migration.
Bug: 13406708
Change-Id: I4bae53e43cb7653eac3b5bd13da2d2bc8aaf88a9
2014-05-13 01:28:30 +09:00
Jean Chalard 61ddac28de Merge "Add initial reordering rules for Myanmar" 2014-05-12 11:29:53 +00:00
Keisuke Kuroyanagi 9d7e8c717f Support unigram historical information migration.
Bug: 13406708
Change-Id: Ibed15b3bc5d5ae68faefa379028dbe10d32b0c0f
2014-05-12 19:21:06 +09:00
Jean Chalard 281dbc3973 Add initial reordering rules for Myanmar
Bug: 13945569
Change-Id: Ib546ba110e87bf72afa7f42c878cc5f638bff6c7
2014-05-12 19:17:47 +09:00
Keisuke Kuroyanagi 455dc84cf2 Add VERSION4_TEST for testing.
Bug: 13406708
Change-Id: I0b434717ea3edbb131650af634c53cfbfe113c3e
2014-05-09 15:17:01 +09:00
Jean Chalard 29c00ff538 Introduce clustering punctuation
Bug: 10081730
Change-Id: If198fa3df68ecb267da0a278da41fd509d6165f1
2014-05-01 15:45:24 +09:00
Keisuke Kuroyanagi 1737b7ff5c Use ReentrantReadWriteLock in ExpandableBinaryDictionary.
Bug: 8187060
Change-Id: Ic665f0a5e940708aa9addedac068a64900b307e7
2014-04-28 20:56:01 +09:00
Keisuke Kuroyanagi 67c0ed8f8c Handle user history dictionary as an ExpandableBinaryDictionary.
Bug: 13755213
Change-Id: I1ea8a6df007af7153852f2d32bf5e8ec669c432b
2014-04-24 14:48:01 -07:00
Keisuke Kuroyanagi 2dcb5c1b4d Remove clearAndFlushDictionary() and use clear().
clearAndFlushDictionary() was needed when dictionaries are constructed
in java side. All expandable dictionaries now use native code; thus,
this method is same to clear() and no longer needed.

Bug: 13755213
Change-Id: Ifd836e64f8ff807930f7cd2319b103b65e8fce70
2014-04-24 11:25:47 -07:00
Keisuke Kuroyanagi 3b7984752c Support creating BinaryDictionary without creating dict file.
Bug: 14166482
Change-Id: Ic8c78ec2c8f39358a1f085a041b608972a380eef
2014-04-22 13:18:34 -07:00
Keisuke Kuroyanagi ce76821dce Revert "Support creating BinaryDictionary without creating dict file."
This reverts commit 89939b8708.

Change-Id: I8ca1b55609ad305a93178063bd88bd1cede872af
2014-04-22 19:34:44 +00:00
Keisuke Kuroyanagi 89939b8708 Support creating BinaryDictionary without creating dict file.
Bug: 14166482
Change-Id: Ib065279f96e227ab0fee7c8141560c4ada744d3b
2014-04-22 12:01:33 -07:00
Jean Chalard 2282e8520a Fix updating the shift state upon backspace
Bug: 13514349
Change-Id: If4c9db12b0ab5be676f7a2f72715f469066ee537
2014-04-14 21:28:24 +09:00
Jean Chalard 4370ff0998 Fix some flaky tests.
In tests, we create many instances of LatinIME, but we never
destroy them. That means we never close the dictionaries nor
the handlers.
This change calls onDestroy, which closes all dictionaries, and
adds some code to finish the handlers.

Change-Id: I942517a2a940c54256b08763f6b38f5b55809f55
2014-04-10 17:32:05 +09:00
Jean Chalard 5f430e0189 [CB25] Refactor some array copying
Bug: 13406701
Change-Id: I09edd822f5cc2446b324d41c76d835bcff1191e6
2014-04-09 18:38:29 +09:00
Jean Chalard 90608190ec Add shift mode tests
Change-Id: I067e91a1f899c1f83fd60adeae66495606812a95
2014-04-08 22:24:25 +09:00
Jean Chalard 28a59dd049 Fix a bug with double-space-to-period
Bug: 13778001
Change-Id: I3ebd57950cdfacbbcdc64ed214c0590519a0665c
2014-04-03 22:07:57 +09:00
Tadashi G. Takaoka 9364d46ac3 Add SpacebarLanguageUtils class
The SpacebarLanguageUtils class is separated from SubtypeLocaleUtils
and handles the language name on the spacebar.

Bug: 8084704
Change-Id: I82f79a061d4f0cc2895263298c3ebf8ee444c61d
2014-04-01 12:17:06 +09:00
Keisuke Kuroyanagi 781e3df73b Merge "Dictionary migration in Java side." 2014-03-28 08:07:26 +00:00
Jean Chalard 35645ac39a Merge "[CB14.5] Stop copying WordComposers." 2014-03-28 06:51:17 +00:00
Jean Chalard 8e829c37df [CB14.5] Stop copying WordComposers.
This is an overdue refactoring that I have been wanted to
do forever, and that we can at last do now that suggestions
come only from instances of BinaryDictionary instances.

With this, all unit tests and regression tests are
passing again.

Bug: 13667648
Bug: 13665487
Bug: 8636060
Change-Id: Ie23a19f9b7e692edf2ee0b107ddaff2d7db564b6
2014-03-28 15:26:27 +09:00
Tadashi G. Takaoka 2202d47386 Stop displaying locale string on short space bar
Bug: 12070355
Change-Id: I2d6fa20431bc56d5139caeac33e396b73906d075
2014-03-28 13:05:13 +09:00
Keisuke Kuroyanagi a785fa8edd Dictionary migration in Java side.
Bug: 13406708

Change-Id: If83938e4b4810d2e8353c70cdd8ef3ea97a29571
2014-03-27 17:46:35 +09:00
Keisuke Kuroyanagi 6008898b99 Merge "Move code only used for dicttool and tests under tests." 2014-03-27 06:37:10 +00:00
Keisuke Kuroyanagi 93cda5bb39 Move code only used for dicttool and tests under tests.
Bug: 13035567
Change-Id: I13c6df013ef2b67c9bf67455d9c32d283bf9ea2e
2014-03-27 15:30:32 +09:00
Jean Chalard 1079665c3c [CB14] Implement backspace in the combiner chain
Bug: 13622107
Bug: 13406701
Change-Id: I0023b398c4451253f9f717e2bd990b8a054004bc
2014-03-25 17:57:03 +09:00
Jean Chalard 72b67f6541 Rework the logic that tells if the cursor touches words
Bug: 13312942
Change-Id: I6be6a558bbc6c88508150f9c25cadbd0240ff88e
2014-03-20 23:16:53 +09:00
Keisuke Kuroyanagi 599e61d70c Merge "Change default decaying parameters." 2014-03-14 06:16:02 +00:00
Keisuke Kuroyanagi 98705b6bf5 Fix unit tests.
Change-Id: I2a85763358e1eef0f76ef827413afffeb4cb8058
2014-03-14 12:27:23 +09:00
Keisuke Kuroyanagi 73a2426d45 Change default decaying parameters.
Bug: 13458617
Change-Id: I4942af4a48881fb6ca866c74140b262e6d323f4a
2014-03-14 12:23:24 +09:00
Keisuke Kuroyanagi 61467744e7 Unit test update for I7ed95a54344d8b.
Change-Id: Ic8af56b8741ee7c231d73ce6a660fd32c9f5a3b3
2014-03-12 15:41:20 +09:00
Keisuke Kuroyanagi 3ad4af2354 Move DictionaryOptions from FusionDictionary to FormatSpec.
Bug: 8187060
Bug:13035567

Change-Id: Id4f45e589521ae98c926a4c0607be10ce1a983f2
2014-03-06 18:53:09 +09:00
Keisuke Kuroyanagi 516f86815d Separate WeightedString from FusionDictionary.
Bug: 8187060

Change-Id: I40c1dafca3eb52244c64fdb4c1db30a56385d678
2014-03-06 18:53:06 +09:00
Keisuke Kuroyanagi e784148ae6 Separate utility methods from BinaryDictionary.
Bug: 8187060
Change-Id: Ice2984e332b7bd3bb17174aefc80b5635b72fc50
2014-03-05 18:19:34 +09:00
Keisuke Kuroyanagi d302b98ce6 Added a method and run GC for testing.
Bug: 13231889
Change-Id: If64b7422967c3e4107c845072b64a7bb26a35f7e
2014-02-28 18:17:09 +09:00
Jean Chalard 890b44e537 Correctly read the header of APK-embedded dicts
Bug: 13164518
Change-Id: I8768ad887af8b89ad9f29637f606c3c68629c7ca
2014-02-24 22:54:01 +09:00
Tadashi G. Takaoka 8e2951f299 Merge "Fix punctuation test for tablet" 2014-02-21 11:54:28 +00:00
Tadashi G. Takaoka d28a58c25d Fix punctuation test for tablet
It seems that some test devices are tablet and some are phone. The
unit test should aware of which device the test is running.

Change-Id: I8651a540993de29aa1cd9f40919dffe7a8df9512
2014-02-21 17:50:07 +09:00
Keisuke Kuroyanagi 239256b156 Merge "Add an auto-correction by user history test." 2014-02-21 07:59:05 +00:00
Keisuke Kuroyanagi 4cc582f3ba Add an auto-correction by user history test.
Bug: 11122480
Change-Id: I830bb3399f9839a80c6d86fbf582299bce424871
2014-02-21 13:12:26 +09:00
Keisuke Kuroyanagi e03e4257f1 Merge "Add test only methods to test personalized dicts." 2014-02-20 13:25:59 +00:00
Keisuke Kuroyanagi d36328cecf Add test only methods to test personalized dicts.
Bug: 11122480
Change-Id: I79a4a73ff09a2d34d4ca094d705e901fb4bc855c
2014-02-20 22:20:43 +09:00
Keisuke Kuroyanagi 21f9482999 Fix: UserHistoryDictionaryTests.testDecaying().
Bug: 13106697
Change-Id: If81f77c3cefdefae94cb9145aa9f700494f8237a
2014-02-20 21:23:57 +09:00
Keisuke Kuroyanagi 0bc66daae3 Add user history dictionary decaying test.
Bug: 10667710

Change-Id: Ib2be57d8c4cbbb34f64555d84ea6fd571cfdd247
2014-02-20 18:36:46 +09:00
Jean Chalard fbb8cb5a82 Fix build
This is a forgotten rebase

Change-Id: I7c7c381775488ed9239dc284bd9c31247a86a972
2014-02-18 20:08:53 +09:00
Jean Chalard 28e0b24965 Merge "Fix a bug where the cache would be out of sync" 2014-02-18 10:58:50 +00:00
Jean Chalard fe92c174ea Fix a bug where the cache would be out of sync
During recorrection, the cursor position when calling
commitText is not necessarily at the end of the
composing text.
Besides, RichInputConnection assumes the cursor is
always after any composing text. This is not correct,
but in the practice, it seems all code paths work.
We should fix this in the future.

Bug: 13060691
Change-Id: I15f71fff62d36e80cf6e4a022c5e78af634b199d
2014-02-18 19:55:54 +09:00
Jean Chalard 63be066544 Cleanup.
Less code, less chance of stuff escaping, and a bit of a clarification.
Yay.

Change-Id: I3193fd8ad7ac28195260cbc231c4e498a63a460c
2014-02-18 17:07:46 +09:00
Yohei Yukawa 6d43124215 Stop using deprecated InputMethodSubtype constructor
The constructors of InputMethodSubtype were deprecated in API level 19.
However we cannot yet switch to a new InputMethodSubtypeBuilder style
due to our minimum support API level.

As an intermediate solution, this patch replaces the these API calls
with InputMethodSubtypeCompatUtils.newInputMethodSubtype so that
these legacy API call can be consolidated at the same place.

BUG: 13030512
Change-Id: I561a585f5dbea56c337680b645be5ef07015a0b1
2014-02-17 15:32:33 +09:00
Keisuke Kuroyanagi 95d16561e0 Remove unused code.
Bug: 12810574
Change-Id: I9c7fff60ae0e94d52f3bd19c3e88de5a53b917d7
2014-02-15 17:39:24 +09:00
Keisuke Kuroyanagi 0fc93fe445 Implement PatriciaTriePolicy::getNextWordAndNextToken().
Bug: 12810574
Change-Id: Id1d44f90de9455d9cbe7b6e0a161cae91d6d422c
2014-02-15 17:39:20 +09:00
Keisuke Kuroyanagi 85fe06e759 Merge "Remove unused argument from readDictionaryBinary." 2014-02-14 10:37:56 +00:00
Keisuke Kuroyanagi 8e3a1d0f89 Remove unused argument from readDictionaryBinary.
Bug: 12810574
Change-Id: Ice415ebd8d11162facca3fe8927ef8a616b11424
2014-02-14 19:02:15 +09:00
Keisuke Kuroyanagi 8fa7a09f1e Merge "Implement PatriciaTriePolicy::getWordProperty()." 2014-02-14 09:08:09 +00:00
Tadashi G. Takaoka e4b0add353 Fix SpacingAndPunctuationsTests due to I2219224840
Bug: 12640318
Change-Id: If0b0696b937c580d69cb909ddaf414d01ea2c01b
2014-02-14 17:59:53 +09:00
Keisuke Kuroyanagi c63d183473 Implement PatriciaTriePolicy::getWordProperty().
Bug: 12810574
Change-Id: I7bcccfd3641ebbcf2b8d857d33bb4734c42af5eb
2014-02-14 17:56:45 +09:00
Tadashi G. Takaoka a273319c59 Add PunctuationSuggestions class
This change must be checked in together with I366c477516.

Bug: 12640318
Change-Id: I8d3864b9d9649c9e3306e82b01a6327b11281b1f
2014-02-14 14:13:39 +09:00
Tadashi G. Takaoka bd0591ce62 Merge "Make InputLogicTest more robust" 2014-02-13 10:44:44 +00:00
Tadashi G. Takaoka da973e75dc Make InputLogicTest more robust
Change-Id: I134f14971126cbeed05b472c08747f2b88ad30e6
2014-02-13 19:38:51 +09:00