aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java (follow)
Commit message (Expand)AuthorAgeFilesLines
* Use a formula packing more information into 4 bits field•••Bug: 6313806 Change-Id: Id0779bd69afae0bb4a4a285340c1eb306544663a Jean Chalard2012-05-151-8/+33
* Small optimization•••Performance gain is < 2% Bug: 6394357 Change-Id: I2b7da946788cf11d1a491efd20fb2bd2333c23d1 Jean Chalard2012-05-141-1/+1
* Small optimizations•••Bug: 6394357 Change-Id: I00ba1b5ab3d527b3768e28090c758ddd1629f281 Jean Chalard2012-05-141-4/+6
* More optimizations•••We don't merge tails anyway, and we can't do it any more because that would break the bigram lookup algorithm. The speedup is about 20%, and possibly double this if there are no bigrams. Bug: 6394357 Change-Id: I9eec11dda9000451706d280f120404a2acbea304 Jean Chalard2012-05-141-4/+11
* Write the bigram frequency following the new formula•••This also tests for bigram frequency against unigram frequency Bug: 6313806 Bug: 6028348 Change-Id: If7faa3559fee9f2496890f0bc0e081279e100854 Jean Chalard2012-05-111-5/+21
* Refactor a method•••Rename it, rename parameters, and add a parameter that will be necessary soon. Also, rescale the bigram frequency as necessary. Bug: 6313806 Change-Id: I192543cfb6ab6bccda4a1a53c8e67fbf50a257b0 Jean Chalard2012-05-111-10/+14
* Add a flag for bigram presence in the header•••This is a cherry-pick of Icb602762 onto jb-dev. Bug: 6355745 Change-Id: Icb602762bb0d81472f024fa491571062ec1fc4e9 Jean Chalard2012-04-261-3/+7
* Ignore bigrams that are not also listed as unigrams•••This is a cherry pick of I14b67e51 on jb-dev Bug: 6340915 Change-Id: Iaa512abe1b19ca640ea201f9761fd7f1416270ed Jean Chalard2012-04-261-2/+10
* Merge "Fix binary reading code performance."Jean Chalard2012-04-231-1/+10
|\
| * Fix binary reading code performance.•••This is not the Right fix ; the Right fix would be to read the file in a buffered way. However this delivers tolerable performance for a minimal amount of code changes. We may want to skip submitting this patch, but keep it around in case we need to use the functionality until we have a good patch. Change-Id: I1ba938f82acfd9436c3701d1078ff981afdbea60 Jean Chalard2012-04-241-1/+10
* | Fix a bug where a node size would be seen as increasing.•••The core reason for this is quite shrewd. When a word is a bigram of itself, the corresponding chargroup will have a bigram referring to itself. When computing bigram offsets, we use cached addresses of chargroups, but we compute the size of the node as we go. Hence, a discrepancy may happen between the base offset as seen by the bigram (which uses the recomputed value) and the target offset (which uses the cached value). When this happens, the cached node address is too large. The relative offset is negative, which is expected, since it points to this very charnode whose start is a few bytes earlier. But since the cached address is too large, the offset is computed as smaller than it should be. On the next pass, the cache has been refreshed with the newly computed size and the seen offset is now correct (or at least, much closer to correct). The correct value is larger than the previously computed offset, which was too small. If it happens that it crosses the -255 or -65335 boundary, the address will be seen as needing 1 more byte than previously computed. If this is the only change in size of this node, the node will be seen as having a larger size than previously, which is unexpected. Debug code was catching this and crashing the program. So this case is very rare, but in an even rarer occurence, it may happen that in the same node, another chargroup happens to decrease it size by the same amount. In this case, the node may be seen as having not been modified. This is probably extremely rare. If on top of this, it happens that no other node has been modified, then the file may be seen as complete, and the discrepancy left as is in the file, leading to a broken file. The probability that this happens is abyssally low, but the bug exists, and the current debug code would not have caught this. To further catch similar bugs, this change also modifies the test that decides if the node has changed. On grounds that all components of a node may only decrease in size with each successive pass, it's theoritically safe to assume that the same size means the node contents have not changed, but in case of a bug like the bug above where a component wrongly grows while another shrinks and both cancel each other out, the new code will catch this. Also, this change adds a check against the number of passses, to avoid infinite loops in case of a bug in the computation code. This change fixes this bug by updating the cached address of each chargroup as we go. This eliminates the discrepancy and fixes the bug. Bug: 6383103 Change-Id: Ia3f450e22c87c4c193cea8ddb157aebd5f224f01 Jean Chalard2012-04-241-5/+25
|/
* Change binary dictionary output buffer size to match dictionary size.•••Bug: 6355943 Change-Id: Iaab7bc16ba0dbc7bfde70b06e7bd355519838831 Tom Ouyang2012-04-191-32/+65
* Add support for German umlaut and French ligatures flags•••Bug: 6202812 Change-Id: Ib4a7f96f6ef86c840069b15d04393f84d428c176 Jean Chalard2012-04-061-6/+19
* Remove the shortcutOnly attribute which is now useless.•••Change-Id: Ifccdfdaf7c0066bb7728981503baceff0fedb71f Jean Chalard2012-04-061-3/+2
* Add a simple way to input dictionary header attributes•••Just add them as an attribute to the root of the XML node. Bug: 6202812 Change-Id: Idf040bfebf20a72f9e4370930a85d97df593f484 Jean Chalard2012-04-031-3/+16
* Add read support for string shortcuts for makedict.•••Change-Id: I48ee4fc9ac703ad2a680b3cd848de91c415ea3c8 Jean Chalard2012-03-281-33/+22
* Change the format of the shortcuts in the binary dict.•••This only includes the write part of the change. The read part is coming in a different commit. Change-Id: Iabe7af6cd134462dc19245f5400719920ed31c8f Jean Chalard2012-03-281-44/+107
* Move makedict to LatinIME android keyboard.•••Bug: 6188977 Change-Id: I4d2ef504bb983abbda3cb52ee450cb46f58d95cf Tom Ouyang2012-03-211-0/+1208