Commit Graph

878 Commits (ccfef1083a860ae4cce0ce59b6fcaa20db3fdbf5)

Author SHA1 Message Date
Keisuke Kuroyanagi ca17ed7d9d Fix: BoS prediction is shown after inputting just once.
Change-Id: Ibba209f47cb5b1a4b08281689d607711b8dcfad4
2014-10-06 19:28:39 +09:00
Keisuke Kuroyanagi 6accf63d0a Make unit tests use new entry updating method.
Bug: 14425059
Change-Id: Ie7d92e92822a0d3a8b654d213e55d45aab799f5d
2014-10-06 12:09:15 +09:00
Ken Wakasa faefad5b0f Revert "[ML14] Forward the locale list to relevant places"
This reverts commit 15dbd38283.

Bug: 11230254

Reverting due to unit test breakage.

Change-Id: Icf29ba5c808c754515aef2d1b4162d72f606acfe
2014-10-03 23:48:53 +00:00
Jean Chalard 15dbd38283 [ML14] Forward the locale list to relevant places
Bug: 11230254
Change-Id: Idf3ed27b396d63ade9800c72c5ce0ed613f5f669
2014-10-03 23:20:38 +09:00
Ken Wakasa 3a41528cbe Merge "Fix testCharacterTableIsPresent to use BinaryDictUtils.getDictFile" 2014-10-03 12:04:05 +00:00
Keisuke Kuroyanagi 73edc1eed9 Merge "Simplify dictionary creation in unit tests." 2014-10-03 11:42:58 +00:00
Akifumi Yoshimoto 6164f1fcb9 Fix testCharacterTableIsPresent to use BinaryDictUtils.getDictFile
Bug:17097992
Change-Id: Ic26c95fccb63d592883f85fe34f4570f1861b8c3
2014-10-03 20:07:41 +09:00
Keisuke Kuroyanagi ef903a81ac Simplify dictionary creation in unit tests.
Change-Id: Id1b41494701f54651d7f79aba426e15cca8d898d
2014-10-03 19:59:15 +09:00
Keisuke Kuroyanagi 2522a4a477 Fix: NPE in unit test.
Change-Id: I769b43f2afa1151d5c0d9c408018c3932be377dc
2014-10-03 19:53:23 +09:00
Akifumi Yoshimoto 80861cde9d Merge "Fix bug of testCharacterTableIsPresent (dicttool test)" 2014-10-03 10:07:04 +00:00
Akifumi Yoshimoto 71f9b8d50b Fix bug of testCharacterTableIsPresent (dicttool test)
Bug:17097992
Change-Id: Ibe343b8cc704631e84ed9d3a39feee30a54bdc38
2014-10-03 18:56:41 +09:00
Jean Chalard b28d1cc487 Fix a behavior change in dicttool
The behavior change was introduced by I8b3458ad. Concretely,
empty bigram lists would end up as empty lists instead of null.

Change-Id: Ibcdf7e6aabc6aba3f5db0477335882394e050ce5
2014-10-03 18:04:10 +09:00
Jean Chalard fb051c3957 Merge changes I3c1f5ac1,I269c9aa8
* changes:
  Switch code point table
  Test for code point table (dicttool test)
2014-10-03 07:55:59 +00:00
David Faden c92c883fdf Add calls to stub for API to consume gesture data.
Bug: 17400259
Change-Id: Ib3511afffe1d14662e7dd14611f384689516e664
2014-10-03 15:01:34 +09:00
Akifumi Yoshimoto 7e5614520a Merge "Include a code point table in the binary dictionary." 2014-10-02 08:55:18 +00:00
Akifumi Yoshimoto f51d3667fc Switch code point table
Bug:17097992
Change-Id: I3c1f5ac183ebb5d3757b8ff258655869ab61f2e7
2014-10-02 12:28:04 +09:00
Akifumi Yoshimoto 25c884ba65 Test for code point table (dicttool test)
Bug:17097992
Change-Id: I269c9aa86378f32083f8688f4ce91862d47dd181
2014-10-02 12:28:04 +09:00
Akifumi Yoshimoto 9168ab60cf Include a code point table in the binary dictionary.
Bug:17097992
Change-Id: I677a5eb3a704e4386f6573360e44ca335d81d2df
2014-10-02 12:27:49 +09:00
Keisuke Kuroyanagi 108dad1491 Merge "Introduce NgramProperty in Java side." 2014-10-01 07:53:04 +00:00
Keisuke Kuroyanagi c6a6f6a990 Introduce NgramProperty in Java side.
Bug: 14425059
Change-Id: I8b3458ad22730b3dccbe0caea2c5930f5276dc82
2014-10-01 11:21:08 +09:00
Adrian Velicu 9586d69bdf Avoid double space when autocorrect is triggered
Bug: 17596034
Change-Id: Iaa6cc066eefd2436195a91791f2628e9a5f1c449
2014-09-30 15:48:48 +09:00
Akifumi Yoshimoto 0c2cdcc735 Fix bug of testCodePointTable.
Bug:17097992
Change-Id: Ia26bfceb008f52e2c3b760159c5129b7eca5d6d6
2014-09-30 12:49:25 +09:00
Akifumi Yoshimoto 5e828b2c61 Merge "Create a code point table based on occurrence counts." 2014-09-29 06:31:33 +00:00
Keisuke Kuroyanagi 6c7a85cb35 Quit using currentTimeMillis() for user history unit tests.
Change-Id: I24bd81e6781148302d5679850ed0a9bda71a3d27
2014-09-29 14:26:51 +09:00
Keisuke Kuroyanagi a4a4e9d96b Merge "Rename PrevWordsInfo to NgramContext." 2014-09-29 03:00:55 +00:00
Keisuke Kuroyanagi 33b0ebff27 Merge "Refactoring PrevWordsInfo." 2014-09-29 02:33:00 +00:00
Keisuke Kuroyanagi bb0eca5705 Rename PrevWordsInfo to NgramContext.
Bug: 14425059
Change-Id: Id06a71681fa8b5e589e29fba10fe5c1cfed66984
2014-09-29 10:52:18 +09:00
Sandeep Siddhartha 569f6f1c9e Merge "Add authentication/http request related code to LatinIme" 2014-09-26 17:22:12 +00:00
Sandeep Siddhartha 05274d5a0d Add authentication/http request related code to LatinIme
Bug: 17464068
Bug: 17464805
Change-Id: I533ae8821e0628fdf6591538a96ab50f805c0cdf
2014-09-26 10:14:24 -07:00
Keisuke Kuroyanagi bbd6a26be0 Refactoring PrevWordsInfo.
Bug: 14425059
Change-Id: I48a193b965e3055bd10a00046322c2b7b19a6232
2014-09-26 21:46:57 +09:00
Akifumi Yoshimoto fd4cb4bd05 Merge "Read dicttool option for switching code point table" 2014-09-26 06:38:32 +00:00
Akifumi Yoshimoto 8a6e96d286 Create a code point table based on occurrence counts.
Bug:17097992
Change-Id: Ifd76dbd4d385d800af416368e25c9e56a76d0fbf
2014-09-26 15:15:16 +09:00
Akifumi Yoshimoto f4329f7fff Read dicttool option for switching code point table
Bug:17097992
Change-Id: I0b3f12c4450f784b9a33470d1dc4c306062de91e
2014-09-26 15:15:10 +09:00
Tadashi G. Takaoka 90058c3d1f Add an internal state test to ImportantNoticeUtilsTests
On some 32bit-x86 testing emulators, it seems the internal state after
clear the related settings seems like a contradiction state. This CL
adds an test to check such internal state in order to investigate what
is happening on these emulators.

Bug: 17635340
Change-Id: Iba85f06c46959b1dc22e2a9213c50c9e7e30949b
2014-09-26 12:16:54 +09:00
Sandeep Siddhartha 3980675f18 Save/restore account preference when running tests
Change-Id: I0b1ec2144007b60fc53b4fcfa04be1b6dc21ced2
2014-09-25 11:47:28 -07:00
Keisuke Kuroyanagi 951252bf47 Merge "Get stats from dictionary." 2014-09-25 08:24:55 +00:00
Sandeep Siddhartha 145f05d637 Merge "Add account change receiver to handle account removal" 2014-09-24 23:40:58 +00:00
Sandeep Siddhartha d4aec65f65 Add account change receiver to handle account removal
Also cleanup the manifest to group similar components together.
Moving LoginAccountUtils to its own package

Bug: 17464068
Change-Id: Iad7928855531d58334b1e4039bb45b97dde75462
2014-09-24 13:10:54 -07:00
Keisuke Kuroyanagi a8321242c6 Call stopTestModeInNativeCode() in testDecaying().
Change-Id: I939fdbda31ff066ea6e807ad1438a8f77fb6ddef
2014-09-24 08:51:19 +09:00
Tadashi G. Takaoka 620bfb9bb9 am 4c4ba10b: am 71b51590: am a76e11a2: am 1f490d6c: am be4e0d0e: Fix when to show important notice
* commit '4c4ba10bbb257036d7cb6ae8a128263285b7384f':
  Fix when to show important notice
2014-09-23 16:18:45 +00:00
Keisuke Kuroyanagi 504017e6dd Quit using try catch in addAndWriteRandomWords.
Change-Id: I1f3137bacf02bf6bad03a9a99fa56346ff0cd763
2014-09-22 17:39:45 +09:00
Adrian Velicu b12c174c2f Merge "Hiding SuggestedWords.EMPTY and refactoring code that compares SuggestedWords instances directly to it to use isEmpty instead" 2014-09-22 06:20:25 +00:00
Adrian Velicu 30f4a2a4d7 Hiding SuggestedWords.EMPTY and refactoring code that compares SuggestedWords instances directly to it to use isEmpty instead
Bug: 17560717
Change-Id: I7032bf0ab46f9cf5e3b3312a14e689b5496764c1
2014-09-22 14:50:21 +09:00
Keisuke Kuroyanagi b51412a05c Merge "Quit depending on SoftReference in UserHistoryDictionaryTests." 2014-09-22 05:44:42 +00:00
Tadashi G. Takaoka be4e0d0e39 Fix when to show important notice
This CL introduces a timeout duration to show an important notice
message. When the timeout has passed, the important notice message
will be suppressed without user intervention.

This CL also adds unit tests and fixes a bug in
getNextImportantNoticeTitle().

Bug: 17181982
Change-Id: If321c0060cc2f7ca14ad0631b84f4990f88bd659
2014-09-22 14:28:31 +09:00
Keisuke Kuroyanagi d80072c4b8 Quit depending on SoftReference in UserHistoryDictionaryTests.
Change-Id: I96533abf939d39873c5eaab9a9b02f71681aafcf
2014-09-22 14:22:37 +09:00
Keisuke Kuroyanagi 743a9b4499 Get stats from dictionary.
Bug: 16553957
Change-Id: I70c7a7be3c902dc8a0dfe8f946f9ef75ba6c9655
2014-09-22 10:26:19 +09:00
Keisuke Kuroyanagi 12a5c959b3 Add small unit test for adding/removing trigrams.
Bug:17097992
Change-Id: I0ed0b4a172130726d822dadb6d7a806b94130104
2014-09-19 19:16:33 +09:00
Sandeep Siddhartha 84185148c5 Add account listing and preference integration for current account
Bug: 17464068
Change-Id: Idb68a6012b285d6bc4632414bb6d11131148cf67
2014-09-18 10:39:30 -07:00
Jean Chalard 161080c029 Fix tests.
Looper.prepare() is not called automatically for us any more.

Bug: 17518123
Change-Id: I2fb6caa4ef79ce7ed86ff58518f4b000483e508f
2014-09-17 19:12:04 +09:00
Adrian Velicu f116f91033 Making spelling of the word "distracters" consistent
Bug: 17537869
Change-Id: Ibfc1c84aff72aeb76c9b127503369d00f3dfaceb
2014-09-17 17:32:43 +09:00
Keisuke Kuroyanagi 89e34169f8 Get locale using detected language for personalization.
Bug: 16547557
Change-Id: If3d88a548e5a2255ff81c819b056f77bfbe237ae
2014-09-10 18:23:07 +09:00
Keisuke Kuroyanagi d843081193 Move case and OOV detection logic into distracter filter.
Bug: 16547557

Change-Id: I8502585976deb5e93fff3b1e0266654b8a927bda
2014-09-10 11:25:34 +09:00
Jean Chalard 1cf2acd8de am 61e7afa6: am 0eaa25e0: am 914078fd: Fix a bug where recorrection would stop on connectors
* commit '61e7afa6fa98939f9dcb9f7a2ebb5678a51d4201':
  Fix a bug where recorrection would stop on connectors
2014-09-08 13:20:27 +00:00
Jean Chalard b41ee67194 Fix the sentence separator for Hindi.
Change-Id: I623e4ccbc324751eb67ec4bb777e2be5ae2a60d1
Bug: 17418371
2014-09-08 21:54:28 +09:00
Jean Chalard 914078fd91 Fix a bug where recorrection would stop on connectors
Bug: 16733686
Change-Id: I7a9f79a81e33a1f5bf5f3daf0b78d0f1e4447e7a
2014-09-08 21:47:01 +09:00
Jean Chalard b526a894db Fix a bug with the Greek question mark.
Bug: 17398284
Change-Id: If49593e2c959935a183a4cd9d988407cc1160599
2014-09-08 15:33:51 +09:00
Jean Chalard 17901db691 Fix a bug where CAPS_WORDS would not be returned.
Also introduce some unit tests that would have caught the bug.

Bug: 17398284
Change-Id: Idb715b7bd2f70992d6cdf4e25ef368809382caef
2014-09-05 07:56:25 +00:00
Jean Chalard 78bb2dd945 am 3bd8eee3: am 4e28a6a8: Fix an IOOB exception
* commit '3bd8eee3e8c3e89539578a4231661819de65c804':
  Fix an IOOB exception
2014-08-29 19:07:03 +00:00
Keisuke Kuroyanagi addc593349 Fix: PersonalizationDictionaryTests.
Change-Id: I2196c53d8e3ac3ab4c6c2f8e9320489b3a8bacd2
2014-08-29 21:40:59 +09:00
Jean Chalard 4e28a6a844 Fix an IOOB exception
Bug: 17316001
Change-Id: Iaa2cfd30ebbe0d49e10a5c3a30336e06817d0a8b
2014-08-29 06:56:34 +00:00
Keisuke Kuroyanagi e59f3e4fbf Use DictionaryFacilitatorLruCache for personalization.
Bug: 16547557

Change-Id: I5faba5e26d072b49c0fffcaeaf5062f9e0c2dcc0
2014-08-29 12:57:50 +09:00
Jean Chalard f95770354c Straighten the dead char implementation, take 3.
Change-Id: I4f70f6eebe076c7d2b780d25e3a2c1d3faa2edfa
2014-08-28 16:03:45 +09:00
Tadashi G. Takaoka d9069ea076 Merge "Fix Hinglish subtype locale test" 2014-08-28 03:32:42 +00:00
Tadashi G. Takaoka e239500f51 Fix Hinglish subtype locale test
Change-Id: I6fc2fd4f04069485acc432ff957421b85083a344
2014-08-28 11:35:58 +09:00
Ken Wakasa 0ba6bcb16d Revert "Straighten the dead char implementation."
This reverts commit 5ef447aeea.

Reverting because this broke a bunch of unit tests -- https://sponge.corp.google.com/target?id=b6439742-099e-46cb-8f00-d0c602a4d9bb&target=com.google.android.inputmethod.latin.tests&searchFor=&show=FAILED&sortBy=STATUS

Change-Id: Ibbd9e11372993f62e630fd9da37158ffcf47c17a
2014-08-27 15:07:28 +00:00
Keisuke Kuroyanagi d267764d5a Create DictionaryFacilitatorLruCache.
This class is separated from AndroidSpellCheckerService

Bug: 16547557

Change-Id: I3e58521207395588cecb2977234b89067d6da8c3
2014-08-27 22:00:48 +09:00
Jean Chalard 5ef447aeea Straighten the dead char implementation.
This now supports all cases, including cases not supported by
the framework.
Now rebased on top of the right change, and renamed

Change-Id: I7886f0dcbb86cdb4dccec09aa7c52ad339680e04
2014-08-27 17:59:39 +09:00
Jean Chalard 96522da9eb am 2a2d324e: am 8380f921: Fix a bug where the top prediction would disappear.
* commit '2a2d324eb627807a9d09b491fbb4ac78ffb253fc':
  Fix a bug where the top prediction would disappear.
2014-08-26 12:37:17 +00:00
Jean Chalard 8380f921f7 Fix a bug where the top prediction would disappear.
This is because prediction can't be easily distinguished in
style. This fixes the bug by simulating the right members,
but some refactoring should be done to remove useless
booleans.

Bug: 17271923
Change-Id: Ib88f3fb95678021624e59535492926dd315d26fb
2014-08-26 20:35:59 +09:00
Jean Chalard 1a31d784cd Merge "Introduce onEvent() to improve testability" 2014-08-25 09:57:42 +00:00
Jean Chalard ee8ebeecbf Merge "Fix unit tests" 2014-08-25 09:26:17 +00:00
Jean Chalard dc110b2a6a Fix unit tests
Change-Id: I48bfa4e4dd80f36d2fe0a1e9d2a2706533cc722e
2014-08-25 18:19:00 +09:00
Yohei Yukawa c06c6e42ad am 7d146cdb: am cd6ef9a8: Indroduce SuggestedWords#getTypedWordInfoOrNull
* commit '7d146cdbe86692f153fb5b7f781f701a8c04050d':
  Indroduce SuggestedWords#getTypedWordInfoOrNull
2014-08-25 08:25:24 +00:00
Jean Chalard 908f0ed154 Introduce onEvent() to improve testability
...and prepare for the future

Change-Id: Ieed96ab552993fd148e80b9c3355f1b569bd716f
2014-08-25 16:33:47 +09:00
Jean Chalard dc44260484 Merge "Revert "Revert "[ML1] Introduce RichInputMethodSubtype""" 2014-08-25 05:24:28 +00:00
Jean Chalard 85ddfe1317 Revert "Revert "[ML1] Introduce RichInputMethodSubtype""
This reverts commit a63d0a8ee6.

This patch seems to be fine after all, but was submitted without its companion [ML1.1] patch causing a build breakage. Reverting the revert and submitting both at the same time seems like the right thing to do.

Change-Id: Ib8fefa40b74dcee0edb025a52dac9b35c82d49df
2014-08-25 04:42:15 +00:00
Yohei Yukawa cd6ef9a8b1 Indroduce SuggestedWords#getTypedWordInfoOrNull
This is a groundwork for subsequent CLs whith need to
do certain things for and only for the typed word.

Change-Id: I374b79cbc79470f57f523c996010301ea5701a61
2014-08-24 16:32:17 -07:00
Tadashi G. Takaoka 560876508f am cc4d21df: am 2637be27: Support Accept typed word UI
* commit 'cc4d21df7b08c3143dd1c4af786609a279a0bb79':
  Support Accept typed word UI
2014-08-22 14:27:26 +00:00
Tadashi G. Takaoka 2637be27c5 Support Accept typed word UI
Change-Id: I58e95b2791a45afdc7dae8e26dcfc200b3b4b854
2014-08-22 21:25:35 +09:00
Jean Chalard a63d0a8ee6 Revert "[ML1] Introduce RichInputMethodSubtype"
This reverts commit 8ffe4bc932.

Change-Id: I9d4c98b0adfdb78b0f4d376f7691e50d1bd2228f
2014-08-22 09:40:27 +00:00
Jean Chalard 8ffe4bc932 [ML1] Introduce RichInputMethodSubtype
Bug: 11230254
Change-Id: Ic7a1bf938a5a186dcff527b556295aba2406e8b9
2014-08-22 16:34:27 +09:00
Tadashi G. Takaoka ebec5e1338 Merge "Add Hinglish (hi_ZZ) subtype" 2014-08-21 10:22:17 +00:00
Tadashi G. Takaoka d6696ae78b Add Hinglish (hi_ZZ) subtype
Bug: 17169632
Change-Id: Ibee088d76c2b19f1d62a3c9c119452726e856ec8
2014-08-21 19:12:25 +09:00
Keisuke Kuroyanagi ed798fa308 Remove unused dictionary writing methods.
Change-Id: Ica6ac057c0d0f037b7dd5539ab5b591c83bfa4d7
2014-08-21 17:22:54 +09:00
Jean Chalard 36c02f862a Merge "Fix the name of a class" 2014-08-16 04:12:14 +00:00
Jean Chalard 650770da2c Fix the name of a class
Change-Id: I6a6360c3e606ae331b95df17ecf35942be2b89a9
2014-08-19 22:08:59 +09:00
Keisuke Kuroyanagi ffaa9c2a71 Merge "Add language to PersonalizationDataChunk." 2014-08-16 04:12:14 +00:00
Keisuke Kuroyanagi e66d59e6d8 Add language to PersonalizationDataChunk.
Bug: 16547557
Change-Id: I11b82667631cbd5263cc08ccb304fc97bf692050
2014-08-19 18:27:34 +09:00
Keisuke Kuroyanagi a4fb0cc266 Add retry for dict file existence tests.
Change-Id: Ife8d30e1de22336ea87faadb8c6ad7451679337b
2014-08-15 17:55:27 +09:00
Keisuke Kuroyanagi 5409957440 Merge "Remove unigram for v402 with historical info." 2014-08-15 05:02:04 +00:00
Keisuke Kuroyanagi 8890b01550 Remove unigram for v402 with historical info.
Bug: 15531638
Change-Id: If1b73ac693e45a80df987ea16b2dece5597697e8
2014-08-15 15:47:53 +09:00
Jean Chalard 3dbc3ece26 am e04c8b10: am b8d76477: Add the input style to SuggestedWords.
* commit 'e04c8b10d7876effbfdf2340a1fec6bf368c3409':
  Add the input style to SuggestedWords.
2014-08-14 18:10:05 +00:00
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