Commit Graph

68 Commits (2ae75ed56be5d08979d832cf3ddec16dc61e8dcf)

Author SHA1 Message Date
Jean Chalard 2ae75ed56b Start converging two identical methods (A92)
Change-Id: I3c85a80610fde664a328f5606d0724f00d445ebe
2012-07-10 20:13:54 +09:00
Tadashi G. Takaoka d82dcdc924 Add batch input dictionary lookup
Change-Id: I4da3c976838e8eb56c9ec80aafaaf54d759b7981
2012-07-10 20:01:28 +09:00
Jean Chalard f5943153ad Cleanup old methods (A90)
Change-Id: I5435cef8ac6be523934ffa394952cb120c8e89d6
2012-07-10 19:30:46 +09:00
Jean Chalard b30d2185f2 Implement the common Dictionary interface (A89)
This will de-duplicate a lot of existing code.

Change-Id: Idaffb2fde23b9741f057bcb2ecb3dde9d12ea5c5
2012-07-10 19:30:42 +09:00
Jean Chalard a69f12a246 Reduce method visibility (A88)
Change-Id: I29d6afbcba0998558c9b19287a460d9f0e410994
2012-07-10 19:19:47 +09:00
Satoshi Kataoka 71538b08e4 Add input pointers
Change-Id: I95300bf0a847fb86d026e846ff4ad723bb45284f
2012-06-29 18:58:51 +09:00
Jean Chalard 24eec0fa68 Remember the source dictionary for each suggestion.
Change-Id: I3c63372bd5572a479a67eaecfe8c8ea1cabc70d9
2012-06-27 18:17:28 +09:00
Jean Chalard 05efe576f9 Cleanup the dictionary type.
Stop storing an int in each of the different class types, and
just store a string in the top class.

Change-Id: I2af1832743e6fe78e5c1364f6d9cc21252bf5831
2012-06-27 17:31:09 +09:00
Jean Chalard 2f1b6c9ea4 Remove the callback argument to getBigrams() (A16)
Bug: 6252660
Bug: 6166228
Bug: 2704000
Bug: 6225530
Change-Id: I7457ac04f8cd4019fb86c986725aae3de1b1a65e
2012-06-26 17:54:49 +09:00
Jean Chalard 60eed92dc3 Remove the callback argument to getWords() (A15)
Bug: 6252660
Bug: 6166228
Bug: 2704000
Bug: 6225530
Change-Id: I919bf70a1213ab5d7c7a9e5715bd72a6e257148b
2012-06-26 17:36:47 +09:00
Jean Chalard 2225b3bace Do away with Utils#addAllSuggestions (A14)
It's not used any more.

Change-Id: Id9da40fdbf7078f3ac647d1368237d6601f5a2ba
2012-06-26 17:36:47 +09:00
Jean Chalard d82898c5a9 Change the return type of getWords and getBigrams (A8)
This only returns stuff, but it doesn't change yet how the data
is really passed. It merely adds a way of getting the same data.
Later, the old way will be removed.

Change-Id: If3a064de362175fc5a6781b7a97b65d8730aaf3c
2012-06-26 16:44:26 +09:00
Jean Chalard bda7eaa63a Remove dependency on WordCallback from BinaryDictionary (A7)
Bug: 6252660
Bug: 6166228
Bug: 2704000
Bug: 6225530
Change-Id: I8245698fbd170e0f5cbad3c0109774bcaddc0614
2012-06-26 16:42:48 +09:00
Satoshi Kataoka 7368009799 Change JNI for Gesture
Change-Id: I774a0052038d16677f60f7efa11fd266cb5f3088
2012-06-25 18:54:37 +09:00
Satoshi Kataoka c88f61215c Set level 1 as the initial value of the valid words
Bug: 4192129
Change-Id: I867e78ce79c78977d08e8b66881a25b6fe5bf41f
2012-05-29 20:39:39 +09:00
Satoshi Kataoka 2f854e170c Add a JNI to get the frequency
Bug: 4192129
Change-Id: I3f220f5a10114d4eb23956148076cf76220bda0f
2012-05-29 17:21:59 +09:00
satok 0028ed3627 Use "float" instead of "double"
Change-Id: I93ed4d88ede4058f081dd8d634b00dfff4e96d07
2012-05-16 20:45:05 +09:00
Tom Ouyang 4d289d39ae Contacts dictionary rebuilds only when contact names have changed.
Bug: 6396600
Change-Id: Iad693ec4bab6351793d624e5c5b0a9f5c12a60e3
2012-05-11 18:43:53 -07:00
Jean Chalard 522a04ea5b Pass words as int[] to the native code.
We need to get the bigrams during the call to getSuggestions for
bug#6313806. We already give an int[] to getSuggestions and we
wanted to get rid of char[]'s anyway because it doesn't work with
surrogate pairs, so here we go.

Bug: 6313806
Change-Id: I56ce99f1db6b3302cdf42f0527343bded837091e
2012-04-23 16:05:36 +09:00
Jean Chalard 80111f08e2 Pass the previous word down to native code in getSuggestions
Change-Id: I477b631d81ef58461e44954f3ae5fd895928bb97
2012-04-17 20:07:10 +09:00
Jean Chalard ac27e4544b Pass the previous word to getSuggestions
This is a preparative change to bug#6313806

Change-Id: I1be9ec49b21005c1f45ce459fa93712bc74ef3f0
2012-04-17 12:43:53 +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
Jean Chalard b5e1f48987 Remove the now useless Flag class.
Change-Id: Ibe45189b73e2606cf77e30da166dd0d45ae47c5c
2012-04-06 19:47:16 +09:00
Jean Chalard 338d3ec725 Replace the flags in getSuggestions with a boolean.
Change-Id: I0ec44df1979cb1dc21017ea290d2151a2af0e7cd

Conflicts:

	java/src/com/android/inputmethod/latin/Suggest.java
2012-04-06 19:34:48 +09:00
Jean Chalard 24aee9100e Change the flags to a boolean in constructors.
Change-Id: I9939204f3b16346aaebd4d726315ba9c4faf910a
2012-04-06 19:33:01 +09:00
satok 43ebd8a035 Fix the locale of flags in BinaryDictionary
Bug: 6129372
Change-Id: I4958c2aabf651d7e26648a29b75fcc6c77813451
2012-04-04 21:50:42 +09:00
satok 6ba8de2a60 Good bye the proximity logic in Java code
Bug: 4343280
Change-Id: I82f7d08703647a3492ce6e2d3b741146df58927e
2012-03-28 18:42:30 +09:00
satok 01ab7c8b59 ongoing cleanup 2
Change-Id: I66b61cbe491cf8375144e834390beae3209a777d
2012-03-27 16:28:48 +09:00
satok 8980bd4a25 Merge "Cleanup jni 1" 2012-03-23 03:24:08 -07:00
satok 9df4a4527a Cleanup jni 1
Change-Id: Ieb6af8385356e259720b50f1fe46a694a098b30f
2012-03-23 19:03:20 +09:00
Jean Chalard cc78d03a62 Add processing for French ligatures.
Bug: 5140033
Change-Id: I1c2751fc617e662aad9f67506e28a622f81d0bc9
2012-03-23 16:50:59 +09:00
Jean Chalard 6ca3ac08ed Strengthen java code against bad returns from native
This doesn't really fix the following bug but it may alleviate
the symptoms

Bug: 6191885
Change-Id: I0de3f550cc7c6cdf79b291399785ad31b205d2ac
2012-03-21 16:40:26 +09:00
Tadashi G. Takaoka cc8c8b99bd Split Utils class to StringUtils, SubtypeUtils, and JniUtils
Change-Id: I09e91675fe7d573dad8c933ad513b21d7e409144
2012-03-08 20:30:38 +09:00
Jean Chalard ad290d6505 Activate bigram predictions from the binary dictionary
Change-Id: If1cc50539d7677b854b1cd3bea3423c8c0865de5
2012-02-15 19:51:24 -08:00
Jean Chalard 6e082cb30d Convert an internal enum into an int of same underlying value.
Goes together with Id4f4e066

Bug: 5922118
Change-Id: I1e39dd01c67e9284d9d7fe008d868847e69986d7
2012-01-26 13:07:51 +09:00
satok be0cf72253 Move auto correction thresthold to the native code
bug: 5858137

Change-Id: Ic4b6270c6e51ef4ed25a6a1d8ddd7fdfa70fd78d
2012-01-12 19:56:15 +09:00
Tadashi G. Takaoka 5fdcd7d5cd Fix JNI as 64bit ready
Change-Id: I7a3ed2cee3b20744869aa5cf89ff9fd95f5ab8fe
2011-10-31 20:44:01 +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 673cebf9e9 Make use of the FULL_EDIT_DISTANCE flag.
In effect, this stops the spell checker from suggesting overly
long words.
More precisely, it takes advantage of the new facility that
takes into account the whole length of the dictionary word when
computing scores, so words much longer than the input word will
see their score demoted accordingly.

Bug: 5384578
Change-Id: I326cd7c87c3080e7fa8729f78517f8ba13672a9b
2011-09-30 16:00:07 +09:00
satok 40a5f6fa4d Add a flag to demote completed suggestions
Bug: 5390063
Change-Id: I0ef4fbcc705539624269fd2f8c4e782679fc44b3
2011-09-29 19:48:18 +09:00
Jean Chalard 043f784198 Create a way to pass the proximity info to the dictionary
This is a preparative change for inserting the spell checker.

Change-Id: Ie441879cac4f67078ec27a95f1fcbbf3ef373df7
2011-08-04 19:46:21 +09:00
Jean Chalard e93b1f2209 Allow reading a binary dictionary even without proximity info.
This prepares the way for spell checking, which is to be done
without context so without proximity info.

Bug: 4176026
Change-Id: I1b4bfaefe2611e1b484acdf3c33598cb80f81ff4
2011-06-02 12:10:13 +09:00
Jean Chalard 4250eb27f5 Create a dictionary collection and a dictionary factory.
The dictionary collection is a class complying to the Dictionary
interface that acts as a front end to a collection of arbitrarily many
dictionaries of any type.
The dictionary factory is a helper class for creating various
dictionaries and get some meta information about them.

At the same time, this change makes the BinaryDictionary class
not a singleton any more.

This also needs I9afe61a9 to not break the build.

Change-Id: I61fdcc4867fcda18342807bf1865e6e46979e5d5
2011-04-27 17:06:20 +09:00
Jean Chalard 0c8d5ca023 Fix Eclipse warnings.
This change is only there to fix warning issued by Eclipse.
It should have absolutely no impact on the program logic.

Change-Id: Ie0e242ac6c167297d33de19902340b0f6ecae9e1
2011-04-26 16:39:45 +09:00
Jean Chalard 89bd776cf6 Use user-history bigrams when no input if available.
This also fixes a small inconsistency upon clicking on whitespace
twice in a row.
Also add some unit tests for an introduced and an existing method.

Change-Id: I1be2fb53c9624f4d0f5299009632cb4384fdfc15
2011-04-22 15:46:23 +09:00
Jean Chalard c899038eee Move language-specific keyboard setting to resources.
Some flag settings used to be stored in a keyboard layout extravalue setting. This
change:
- Introduces the capability of setting such specific flags in values/config.xml
- Retains the ability to use extravalues (for layout-specific settings), though
  there is no more any such setting at the moment.
- Fixes a bug where loading a dictionary from outside does not initialize the flags.
- Moves Flag to another class.

Note: this needs I705ec68c to avoid breaking the build

Change-Id: Ia7703aae3215b06c0b3cb792821649806e8998c1
2011-04-20 17:31:59 +09:00
Jean Chalard cba93f50c3 Add different ways of reading the dictionary file.
This change adds basic support for an external dictionary provider.
It adds methods for reading the dictionary itself from an asset in
the dictionary provider package directly, obtaining the file name
through the ContentProvider interface; it also adds a way of getting
the data through an InputStream and copying the file locally.

Incidentally this change also adds the code needed to listen for
updating the dictionary provider package and reloading it in time.

This change also goes hand-in-hand with Iab31db6e, which implements
the small closed part of this.

Issue: 3414944

Change-Id: I5e4fff99a59bb99dbdb002102db6c90e6cb41c8a
2011-03-18 12:16:50 -07:00
Tadashi G. Takaoka 071f47140c Refactor BinaryDictionary a bit
This changes:
* Flag initialization code in BinaryDictionary to be more unit test friendly.
* Removing unnecessary class hierarchy of LatinIME inner class WordAlternatives.
* Formatting normalized score neatly.

Change-Id: I9f10c093d4f36258fe883cf3fb10cbbda2770497
2011-03-16 19:46:19 -07:00
Tadashi G. Takaoka e7a2512aa3 Add Utils.equalsIgnoreCase methods
This change also corrects usage of "frequency", "priority" and "score"
* Frequency is the relative probability in dictionary.
* Score is the relative probability in suggestions.
* Priority is kind a sorted score.

Change-Id: Iafb135a4ecdb401cc505014a07c74dfcac44d699
2011-03-16 16:03:05 -07:00
Jean Chalard c2bbc6a449 Use translation of fallback umlauts digraphs for German.
For German : handle "ae", "oe" and "ue" to be alternate forms for
umlaut-bearing versions of "a", "o" and "u".

Issue: 3275926

Change-Id: I056c707cdacc464ceab63be56c016c7f8439196c
2011-03-03 11:52:23 +09:00