Commit Graph

63 Commits (22f01a42fcd91dae2a4e723e2477a480a11daa8e)

Author SHA1 Message Date
Yuichiro Hanada 77bce05e6f [Refactor] Rename BinaryDictReader and BinaryDictDecoder.
BinaryDictReader -> BinaryDictDecoder.
BinaryDictDecoder -> BianryDictDecoderUtils.

Change-Id: Iadf2153b379b760538ecda488dda4f17225e5f37
2013-08-19 19:36:31 +09:00
Yuichiro Hanada 94460eba11 [Refactor] Divide BinaryDictInputOutput into BinaryDictEncoder and BinaryDictDecoder.
Change-Id: I7c3269d77e3e3b567e459dcaa1bc029903941744
2013-08-15 20:23:07 +09:00
Ken Wakasa 117f18e844 Revert "[Refactor] Divide BinaryDictInputOutput into BinaryDictInputUtils and BinaryDictOutputUtils."
This reverts commit 4c63d0614e.

Change-Id: I1fa277d720bab4d895259df7d6d82eebfa5eb6c5
2013-08-15 08:54:29 +00:00
Yuichiro Hanada 4c63d0614e [Refactor] Divide BinaryDictInputOutput into BinaryDictInputUtils and BinaryDictOutputUtils.
Change-Id: I0d476abe763c11ba9005152f928e8dccf15ac9de
2013-08-15 15:46:58 +09:00
Yuichiro Hanada 7ec9db2c34 Remove the code and comments about version 1 format.
Change-Id: I827052f234eeaa4dbcfd37da69a99866896a158b
2013-08-09 16:05:07 +09:00
Jean Chalard 93445b4821 Fix some warnings
Change-Id: I7290cd1fb675a1b85b9b6ac2d464c932b5bca1dd
2013-07-31 16:17:01 +09:00
Keisuke Kuroynagi 109ba3ace3 Merge "Regenerate old version dictionaries using new format." 2013-07-01 07:16:15 +00:00
Keisuke Kuroynagi a62b5b22ef Regenerate old version dictionaries using new format.
Bug: 9617181
Change-Id: I228a3eac959f81b38e4092015e8e3c429d46fa60
2013-07-01 15:25:33 +09:00
Jean Chalard a5e28acf63 Merge "Fix a bug where AOSP Latin IME would not fill dictionaries" 2013-06-28 13:21:31 +00:00
Jean Chalard 555c4236db Fix a bug where AOSP Latin IME would not fill dictionaries
There is no reason not to contact the dictionary provider
when we don't have internet permission or when the URL
is empty. It knows how to handle both these cases.

Bug: 9388602
Change-Id: I30c4540551ad2f5e527d3acd1842bbd749feca89
2013-06-28 12:48:41 +09:00
Jean Chalard e04794cbbe Fix some warnings
Mostly remove unused imports

Change-Id: If8ceffdfad79b78194094527759f5c334746973e
2013-06-27 21:36:52 +09:00
Ken Wakasa e28eba5074 Move util classes to the latin/utils directory
Change-Id: I1c5b27c8edf231680edb8d96f63b9d04cfc6a6fa
2013-06-24 17:04:40 +09:00
Kurt Partridge efd26bb319 Allow downloadable dictionaries in development builds
Bug: 9305379

Change-Id: Iab32753070a056d3861a45aa898911b7ab67dfb6
2013-06-05 22:14:54 -07:00
Ken Wakasa 0d6c87d113 Cleanup an unused return value
Change-Id: I974964aa3cc24b5480e57bd38c197fe7a49acaa4
2013-04-30 16:53:18 +09:00
Jeff Sharkey c5ebc792d6 Avoid leaking AssetFileDescriptor.
Change-Id: Iac388c8aefc684980cb4c7131fb47319f6073eb3
2013-04-29 12:26:44 -07:00
Jean Chalard a995bf4031 Put temp files within app files
Bug: 8715614
Change-Id: I307d83923070994525cf0d27aad403e881a89314
2013-04-25 18:14:40 +09:00
Jean Chalard 0cc0544a29 Merge the dictionary pack in Latin IME.
Bug: 8161354
Change-Id: I17c23f56dd3bc2f27726556bf2c5a9d5520bd172
2013-03-19 15:40:14 +09:00
Ken Wakasa 9c3860ce46 Rename ProductionFlag.IS_EXPERIMENTAL to USES_DEVELOPMENT_ONLY_DIAGNOSTICS
bug: 8393568
Change-Id: Ie5edf44a3627aca9416145aff56bf05bbf2a05f3
2013-03-18 23:15:47 +09:00
Jean Chalard ce487bcf33 Access the dictionary pack only if have INTERNET permission
Bug: 8161354
Change-Id: I68ee3acb2955a017d25666cc2dad791798f9064a
2013-03-18 18:40:33 +09:00
Jean Chalard 76ead0ead0 Fix a possible crash
If the dictionary ID, as indicated in the metadata, is
less than three chars long, it crashes LatinIME.
Of course we don't have such dictionary IDs in the current
metadata, but it's still better to be able to handle
the case gracefully ^^;

Change-Id: I60cdf6f8ecce9f4d44b42ddd5d157aebff9a4163
2013-02-23 01:41:44 -08:00
Jean Chalard 1c5b2a41ec Cleanups
Follow-up to Idc6f419a

Change-Id: I4aae8f4e19f27a0a309879dc19af6e40906d58c5
2013-02-11 21:14:56 -08:00
Jean Chalard af4a7e8c4b Create methods in LatinIME to make the current dict lists
Bug: 7005813
Change-Id: I82232af8e3071333b6fd01e4453b6b3c0a3ddb1f
2013-01-31 09:26:52 +09:00
Jean Chalard d515f134f7 Refactoring
This creates a new DictionaryInfoUtils class and moves a bunch
of static methods there for later usage.

Change-Id: Iecb0643e6029a7be36bd6cb36aa918c40e6d8c6a
2013-01-29 19:16:21 +09:00
Tadashi G. Takaoka 8aa9963a89 Fix Apache license comment
Change-Id: Ic56167f952a7f4449da366e1e81610e72c966086
2013-01-21 22:23:37 +09:00
Jean Chalard b56260b891 [AD4] Actually copy the file in place.
This finally makes it work.

Bug: 7702011

Change-Id: I3508c88567f79598e4d1dff561b6ba7dc5c3808f
2013-01-21 17:58:38 +09:00
Ken Wakasa 710d06cea9 Suppress dictionary pack support when IS_EXPERIMENTAL is true
Change-Id: If8813cb989c1fa8744a3bf36e8514ced3c8f46a3
2012-11-09 15:03:31 +09:00
Jean Chalard 01e0913ad2 Make a better choice for the temporary file
Change-Id: I745bb285b6b52875c8d2b3a94deb962352f9754e
2012-10-12 19:58:07 +09:00
Jean Chalard 66c90cd2ae Put temporary files under a separate directory.
Bug: 7328003
Change-Id: Ibe5278ea209d149f87fd08785c77b17e3859948e
2012-10-11 17:53:06 +09:00
Jean Chalard 99b84b42f9 Use a freq of 1 instead of 0 for non-word shortcuts.
Also fix a spelling mistake in a comment

Bug: 7301525
Change-Id: I4437403dce620fed03871485ee04f13c51ce34fc
2012-10-09 19:16:07 +09:00
Tadashi G. Takaoka a28a05e971 Cleanup: Make some classes as final
Change-Id: I6009b3c1950ba32b7f1e205a3db2307fe0cd688e
2012-09-27 19:03:30 +09:00
Yuichiro Hanada 8adc0154e6 Remove populateOptions(final ByteBuffer buffer).
Change-Id: Ifc4c64c9cffe4f343c5a604c192db010a1792acc
2012-09-18 14:42:52 +09:00
Yuichiro Hanada 65e4970026 Fix hackCanUseDictionaryFile.
Bug: 7169473

Change-Id: I575aaa350042af076a8da5756993cdae9e73422c
2012-09-18 14:19:38 +09:00
Yuichiro Hanada 81d97eec0e Move constants and comments.
Change-Id: Ifd66bda7d528827ba61c60531121ea206a2325be
2012-09-13 14:28:39 +09:00
Yuichiro Hanada d4fe7fda30 Use ByteBuffer when reading FusionDictionary from file.
Change-Id: Ia71561648e17f846d277c22309ac37c21c67a537
2012-08-24 13:31:08 +09:00
Tadashi G. Takaoka 5f282ea9e4 Add CollectionUtils class to create generic collection easily
Change-Id: I6b4de9187e122298e5e9cd8ddc9070d062df6a89
2012-08-22 10:21:38 +09:00
Jean Chalard 13822d2b05 Hack to skip reading an outdated binary file.
Bug: 7005813
Change-Id: Ie0d8d4b2d5eb147838ca23bdd5ec1cecd4f01151
2012-08-20 13:56:52 +09:00
Jean Chalard b9e2bce95e Remove an updated dictionary that changed locales
When a dictionary changes locale, we need to remove the file
that corresponds to the old version. It has a different path
than the new one, so we have to search for it explicitly.

Bug: 6540631
Change-Id: Ie9d63ba636651fe90f8fbb9627b7265ac7b34ccd
2012-05-23 15:59:49 +09:00
Jean Chalard 0df78d46da Use the best matching cached dictionary for each category
Bug: 6327270
Change-Id: I5a0e732c8a3fd55fd8ac3c8fe1c58e7f91555d97
2012-04-23 12:37:52 +09:00
Jean Chalard cec8552b18 Pass a parameter to the dict pack if we don't have a default dict
Also, optimize quite a bit the code that decides whether we have
a default dict or not.

Bug: 5705834
Change-Id: Ied20fbcbbc42cbe8c01759d11b1804d1156c6960
2012-04-12 13:05:31 +09:00
Jean Chalard e6269759d6 Read the dictionary resource in a more sensical place.
We don't need to pass this down all the way from LatinIME any more.
It fetched be done exactly where it needs to be.

Change-Id: I9f277f9c4f9de70ae755a1334d86c67bbb24c988
2012-04-11 21:03:21 +09:00
Tadashi G. Takaoka 78ab80844b Add language suffix to main dictionary
Bug: 6319377
Change-Id: Ie6a887fefa12e33c17bfeb5d22984e7c1a7bdb46
2012-04-11 16:11:34 +09:00
Tadashi G. Takaoka 16c6f35570 Add RunInLocale class to guard locale switching
Bug: 6128216
Change-Id: I8d9c75c773c3de886183b291ada7a3836295839b
2012-04-03 17:43:45 +09:00
Ken Wakasa 660776e09b Small performance improvement by removing interface accesses.
Change-Id: I6d91f3b086470b79306dbe2874db9748b9e0eb5f
2012-03-17 01:53:51 +09:00
Jean Chalard 9242a2bcf8 Fix string iterations in a couple places.
Seems I didn't get how to iterate on a String correctly >.>
Talk about a big bug. Anyway, I think it's working now.

Bug: 5955228
Change-Id: I988c900cf2a16c44b9505cfd4f77c7cda7e592f0
2012-02-03 11:15:46 +09:00
Tadashi G. Takaoka ab72a97d7c Cleanup unused import
This change also gets rid of several compiler warnings.

Change-Id: I23962edaadad18a6e0395d528af17b909dcf5dad
2011-10-04 12:46:20 +09:00
Jean Chalard ef35cb631c Move locale-related utility methods to LocaleUtils.
Change-Id: I7e9e6e5bc4486d8618d0213b112308c3d305c15e
2011-08-29 12:29:35 +09:00
Jean Chalard de4e8dedcc Allow sharing dictionaries between similar locales.
Bug: 5058488
Change-Id: Ib12013f58afad957a8205b439f87480cc12ea06f
2011-08-25 19:42:06 +09:00
Jean Chalard 7b1f74bb9d Refactoring: cut out a method for caching a word list
This is preparation to have the decrypting/unzipping code
moved over to LatinIME.

Bug: 5095140
Change-Id: Ic3fdcc3de673b46cef2eb9ebe6a52cbdd614e50a
2011-08-24 15:09:57 +09:00
Jean Chalard ee7daefd97 Check the main dict id to be able to fallback.
Bug: 5095140
Change-Id: I02032923ca2a65bd8fbabc0abbe6a476f7542187
2011-08-18 20:09:35 +09:00
Jean Chalard 83207fb482 Move the settings test to a more appropriate place.
This change refactors the dictionary selection code so that the
cached dictionary files list and the settings tests are more
cleanly separated.
This will also help with future refactorings that will test for
the presence of the main dictionary and insert the fall back if
it's not supplied by the dictionary pack.

Bug: 5095140
Change-Id: I8d7caad7c054031df71fe78b043801a774d50f65
2011-08-18 19:35:52 +09:00