aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/Suggest.java (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Convert an internal enum into an int of same underlying value.Jean Chalard2012-01-261-6/+6
| | | | | | | Goes together with Id4f4e066 Bug: 5922118 Change-Id: I1e39dd01c67e9284d9d7fe008d868847e69986d7
* Fix SuggestTestsTadashi G. Takaoka2012-01-131-1/+1
| | | | | | | We need revised scoring test because dictionary look up algorithm has been changed significantly since this SuggestTests was made. Change-Id: I69d527a6bfa24ed0dc189fddad1afab0566c6eb8
* Stop a flag from escaping.Jean Chalard2011-12-091-15/+8
| | | | | | | The ultimate intent is to close it up in the settings, as it does not change while typing, only when the keyboard is open again. Change-Id: I12ff56e7482c1584877fe5531473bf03e95a60f6
* Remove a useless methodJean Chalard2011-12-081-4/+0
| | | | Change-Id: Ib6a0ee21bfe2000231f9ba7bcad4b18ae57e4249
* Keep count of the trailing single quotes for suggestionsJean Chalard2011-11-291-11/+19
| | | | | Bug: 5665809 Change-Id: I4d9100dbe980861ccb55c78464524be670cac1f7
* Special case quotes at start and end of wordsJean Chalard2011-11-211-13/+30
| | | | | | | | | | | Single quote at start of word is not considered a part of a word any more. Single quote at the end of a word now behave like capitalization: lookup in the dictionary is done *disregarding* a final quote, and it is forcefully added back into the suggestions afterwards. Bug: 5566368 Change-Id: I14dd3815f4b743edba56d64a3abdf4b73d863a6a
* Make some private method staticTadashi G. Takaoka2011-10-281-2/+3
| | | | Change-Id: Ia23765268be0ef89d7fe7c3f5372ed32d6615765
* Use the whitelist as a dictionary in the spell checker.Jean Chalard2011-10-071-3/+3
| | | | | Bug: 5402436 Change-Id: If89b8bbdebf6751697c4788270d01d4639cff665
* Make the whitelist an instanciable class.Jean Chalard2011-10-061-8/+10
| | | | | | | | This goes together with I6b8628b9acc32449e4147a2a754b222fbb76c754 or it will break the build Bug: 5402436 Change-Id: I07c6266b713773a8de80bb22afdd4c566261f78a
* Remove code related to AutoTextsatok2011-10-031-34/+6
| | | | | | Bug: 5245751 Change-Id: Ic02f951e8e1dbde9d8964d2c16e4928fb374ca41
* Avoid returning an object that's still used internallyJean Chalard2011-09-151-4/+2
| | | | | | | | | | | | There is no definite path known for this to end up being touched by other classes, but we could imagine through some way or some other it ends up shoved in the stringbuilder pool, leading to catastrophic results. Hopefully related to Bug: 5248688 Change-Id: Ib8abfc31263cbf31d515ed607ced5d8253971938
* Fix a bug where autotext would occasionally not workJean Chalard2011-09-011-15/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Autotext correction would check whether the first suggestion so far was the same as what Autotext would return, and if it was indeed the same, would not send its result as autocorrect. However, the first suggestion is not guaranteed to have a high enough score to trigger autocorrection, and there would be cases where a word in autotext would not get autocorrected because the word came out of bigram suggestions. These occurrences would be extremely rare, as they would require concomitant insert between autotext for one char and bigram suggestion. It is, in fact, probably limited to the capitalization of "I". This did not happen in gingerbread because gingerbread would not register 1-letter words as valid bigrams. This fix works by just always sending the result of autotext regardless of whether it is already the first suggestion or not. This is okay because duplicates are removed afterwards anyway - and this processing is absolutely necessary because the autotext'd word may actually be somewhere else in the suggestion, so it made really no sense checking for only the first one. Please note that there is also a race condition that can result in "i" not being converted to "I": at the moment, Latin IME relies on having the suggestions evaluated at the time autocorrection is performed, but when typing very, very fast, those messages may have been canceled. This is not limited to the autocorrection of "i", but affects all autocorrections. It requires a nearly inhumane typing speed to trigger, but hitting "i" and space in turn as fast as one can it's possible to reproduce occasionally. Bug: 5135113 Change-Id: I530ea6212487300001a2c0fc5b25a5c7716bdf63
* Fix a bug with the string pool.Jean Chalard2011-08-231-1/+8
| | | | | | | | This also adds some optional debug code to detect more easily possible future occurrences of the same problem. Bug: 5195017 Change-Id: I2558b468e46f7090de868f1ec2dc9e24895d670f
* Move the dupes-removing method to the Utils classJean Chalard2011-08-191-28/+1
| | | | | | This is preparation for bug: 5175740 Change-Id: I18b2042317f740cb1e021d3dfbf90ecfbb1a1d37
* Make the string builder pool in Suggest a singleton.Jean Chalard2011-08-181-40/+14
| | | | | | | This is internal refactoring, done as preliminary work to fix Bug: 5175740 Change-Id: I21bd4c001c27e7b925ddb87a152105b4dcab320a
* Refactor string removal to make it staticJean Chalard2011-08-181-7/+8
| | | | | | | | | The next step is to move this over to the Utils class. The ultimate goal is to make use of the duplicate removal code also in the spell checker as per Bug: 5175740 Change-Id: Ica36691b843b0713b832c56ffc65e5b2ec427c4a
* Stop reloading contacts when not appropriate.Jean Chalard2011-08-091-1/+7
| | | | | | | | | | A recent change had the contacts reloaded every time a new field is touched. This change not only fixes the problem, but also removes reloading contacts when changing language, which should make language switch within LatinIME lighter. Bug: 5125034 Change-Id: Ia61c4f75a8617113cdce88a2e2c6fdf073146a2d
* Correction mode should not rely on the existence of the main dicKen Wakasa2011-08-081-0/+2
| | | | | bug: 5114094 Change-Id: I2088918ec2c9ad6f8db13b55e58d3e73e180aef8
* Create a way to pass the proximity info to the dictionaryJean Chalard2011-08-041-6/+10
| | | | | | This is a preparative change for inserting the spell checker. Change-Id: Ie441879cac4f67078ec27a95f1fcbbf3ef373df7
* Load the binary dictionary asynchronously.Jean Chalard2011-07-271-15/+35
| | | | | | | | | This should help with LatinIME opening performance. It should not be merged before Ia9e4741f (if it is, there is a race condition where the wrong dictionary is opened). Bug: 5023141 Change-Id: I39c52de70a449929a622dddfdd92b38425ad9416
* Rename AutoDictionary to UserUnigramDictionary.Jean Chalard2011-07-151-8/+14
| | | | | | | ...and adjust internal functions, variables and constant names. Bug: 3459274 Change-Id: I1b11c6adfee360ac0fc22d627955688b3dbdcffc
* Support Turkish keyboardTadashi G. Takaoka2011-06-211-0/+3
| | | | | | | | | I left TODOs in Suggest.java because we must pay attention to locale when changing character's case. Filed another Bug: 4769095 to track that. Bug: 4768050 Change-Id: I1ae2c4ffd2208403a8c2a25dd3a56b71dcefc826
* Close dictionary appropriatelyTadashi G. Takaoka2011-06-201-28/+21
| | | | | | | | The dictionary that extends ExpandableDictionary must be closed when it becomes unused. Bug: 4725930 Change-Id: Ib5d2c39771fb7010d303a26d1ea1c8e237c0101f
* Implement expandable candidates paneTadashi G. Takaoka2011-06-141-1/+1
| | | | | | | | | | This change removes horizontal scroll from candidates strip. Instead of that this change introduces "fixed 3 items candidates strip" and "expandable candidates pane". Bug: 4175031 Change-Id: Ia367d9074436fdea76d3b653d81798ce2749170e
* Add an option to use or not the contacts dictionary.Jean Chalard2011-06-131-1/+6
| | | | | Bug: 4586840 Change-Id: If62cd57e5ab661e6a51a5442d09bf0af8f08f263
* Create a dictionary collection and a dictionary factory.Jean Chalard2011-04-271-10/+8
| | | | | | | | | | | | | | | 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
* Fix Eclipse warnings.Jean Chalard2011-04-261-1/+1
| | | | | | | This change is only there to fix warning issued by Eclipse. It should have absolutely no impact on the program logic. Change-Id: Ie0e242ac6c167297d33de19902340b0f6ecae9e1
* Use user-history bigrams when no input if available.Jean Chalard2011-04-221-16/+31
| | | | | | | | 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
* Check the availability of layouts for showing the input languages in the ↵satok2011-04-211-1/+1
| | | | | | | | settings Bug: 4316889 Change-Id: I746b3ff79c2a6cd4925fca1817d5b209623b5108
* Move language-specific keyboard setting to resources.Jean Chalard2011-04-201-4/+4
| | | | | | | | | | | | | | 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
* Add different ways of reading the dictionary file.Jean Chalard2011-03-181-2/+17
| | | | | | | | | | | | | | | | | | 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
* Refactor BinaryDictionary a bitTadashi G. Takaoka2011-03-161-4/+6
| | | | | | | | | 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
* Add Utils.equalsIgnoreCase methodsTadashi G. Takaoka2011-03-161-59/+41
| | | | | | | | | 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
* Avoid the removal of high-ranking exactly typed candidates.Jean Chalard2011-03-151-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | It used to be the case that the scoring system turns up the same word that was entered with a different capitalization, but with a lower score than some other, more frequent word. To cope with this, there was code that would order such candidates in the first slot no matter what. This processing is now useless because fully matching words now have a huge boost that ensures they will get to the top of the list, before any non-fully matching word (which means, differing only by capitalization or accents). The bug that did happen with this was, if a fully-matching word got matched by several processing passes, and the (chronologically) later score affected to this word was weaker, it would result in the duplicate removal pass removing the stronger score. This in turn would mess with autocorrect. In an effort to keep the risk at a minimum for MR1, this change does not actually remove the useless code, but adds a check in the odd case to avoid the bad situation. Another change will remove the code for ICS release. bug: 4100269 Change-Id: I18c0575332981ffec0e257e26a360995838d521e
* Add whitelist dictionarysatok2011-03-081-43/+53
| | | | | | Bug: 3447571 Change-Id: I538e4e706982129b666ca1ab1085f1b68b69f87f
* Cleanup Suggest to be able to be unit test readyTadashi G. Takaoka2011-03-031-59/+52
| | | | | Bug: 3414081 Change-Id: Ia76afac4b1a61b8953a215b7cbdb7557736f7b9c
* Move the auto correction functionalities to AutoCorrection.javasatok2011-03-031-65/+49
| | | | | | - Also removed a quick fix for 2nd or more suggestions. Change-Id: I7bf46a9cd6a727473e68836954fca160c9d853e6
* Clear suggestion strip when the suggestion startsKen Wakasa2011-03-021-1/+1
| | | | | | | bug: 3488704 bug: 3480132 Change-Id: Ie895d2ad1b58dc65fe16d65baa6fccafd4a142bb
* Remove next letters frequency handlingTadashi G. Takaoka2011-02-171-20/+6
| | | | | Bug: 3428942 Change-Id: Id62f467ce4e50c60a56d59bf96770e799a4659e2
* Add unit test helper method to BinaryDictionary and SuggestTadashi G. Takaoka2011-02-081-0/+7
| | | | | Bug: 3414081 Change-Id: Idee64010f2f423d3c7c548d0279c7bf287088762
* Move and rename computeProximityThresholdTadashi G. Takaoka2011-02-081-7/+7
| | | | | | | | | | | Move and rename KeyboardView.computeProximityThreshold to KeyDetector.getMostCommonKeyWidth. And make it public for unit test use. This is a part of multi-project change (If751659a, Idb18f362) Bug: 3414081 Change-Id: If751659a53c7412f836d6d28866760ffe84b179b
* Add debugging info for Latin IME.Jean Chalard2011-02-011-4/+28
| | | | | | | | | Add frequency of candidates in the candidates view when the debug mode is active. Bug: 3312867 Change-Id: Ie911f14ef11b2fa02af8f3a74302129f16ed0604
* Merge "Fix auto-correction threshold and promote full matched words" into ↵satok2011-01-261-1/+1
|\ | | | | | | honeycomb
| * Fix auto-correction threshold and promote full matched wordssatok2011-01-271-1/+1
| | | | | | | | | | | | | | | | | | | | Bug: 3374359 Bug: 3278422 "zbe" will be auto corrected to "be" by fixing s-line "teh" will be auto corrected to "the" by promotion of full matched words Change-Id: I314c632820e4e0b1501edeca60ada205d291451f
* | Fix safety net not to be enabled at aggressive autocompletion modesatok2011-01-271-0/+4
|/ | | | | | Bug: 3374359 Change-Id: I7b1dbeb64a87dda05397c236bb58da292f819471
* Dim previously suggested wordssatok2011-01-211-8/+8
| | | | Change-Id: Id673c03bfa22ea9ce1bedb5174d8309a37a2a460
* Add a safety net for auto-correction.satok2011-01-191-7/+18
| | | | | | Bug: 3353956 Change-Id: I6a32632b2f986f0d9a07aa72f256a2c41cc09873
* Fixes in close() in BinaryDictionary.Ken Wakasa2011-01-171-4/+4
| | | | | | | Avoid using 'synchronized' in finalizer as well. bug: 3340837 Change-Id: I9b28f54e4490ecb844ba33a379f71b625e4246a2
* Load main dic in nativeKen Wakasa2011-01-071-15/+26
| | | | | | | Follow up to Id57dce51 bug: 3219819 Change-Id: I00e11ef21d0252ffa88c12dffb9c55b0f2e19a66
* Consolidate main dictionary files.Ken Wakasa2011-01-051-1/+1
| | | | | | | | | This change is a preparation for upcoming optimizations on dictionary file loading. * We can consolidate dictionary files because we are no longer relying on Asset Manager. * Stopping compressing dictionary files as planning to use mmap() on the region in the apk file. * Probably we won't rely on Asset Manager. Instead we'll probably use offset and size obtained from AssetFileDescriptor. Change-Id: Id57dce512fd3d2397a58628f8264bd824194da76