Commit Graph

635 Commits (5a2406126707dbe38ed4785439c1610db48a7344)

Author SHA1 Message Date
Keisuke Kuroyanagi c5f35a9c86 Merge "Calculate parent offset from the head of moved node." 2013-09-10 06:08:56 +00:00
Keisuke Kuroyanagi 9c820de7a1 Calculate parent offset from the head of moved node.
Bug: 6669677
Change-Id: I710453f1c37ec14e5b6830595c1afb2caff83cf2
2013-09-10 15:03:44 +09:00
Keisuke Kuroyanagi 1d4a07f6c7 Merge "Re-call getBuffer after writing in bigram/shortcut policy." 2013-09-10 03:27:30 +00:00
Keisuke Kuroyanagi c987120cbc Re-call getBuffer after writing in bigram/shortcut policy.
Bug: 6669677
Change-Id: I35dc290aa9582e019681b8aae49db3f8d37c90d4
2013-09-10 12:12:42 +09:00
Keisuke Kuroyanagi a159ad473c Implement create children array and add child method.
Bug: 6669677
Change-Id: Ic89c3dfe01937e771db8fc59d5259496a9464a47
2013-09-09 16:44:17 +09:00
Keisuke Kuroyanagi 7bd7dc5d0d Implement update node probability method.
Bug: 6669677
Change-Id: I61ac0d05e362fc7d8a967ddd8286580998c70487
2013-09-09 15:29:11 +09:00
Keisuke Kuroyanagi 3fbc5ef196 Implement inserting new node into PtNode array.
Bug: 6669677

Change-Id: I0171476231181e41234dde76ac9061febb2e8c35
2013-09-06 20:40:08 +09:00
Keisuke Kuroyanagi 40182c737d Merge "Compute probability using structure policy." 2013-09-06 08:10:07 +00:00
Keisuke Kuroyanagi 65d19946be Compute probability using structure policy.
Bug: 6669677
Change-Id: Icd50fc30274cce65ebeb2e7cc8368b59e5cda05a
2013-09-06 16:50:09 +09:00
Keisuke Kuroyanagi e4dcebe0c3 Add node flags creating methods.
Bug: 6669677
Change-Id: Ieb4178da61fa38f6b32baefa099cc0724f9fb6be
2013-09-06 14:56:59 +09:00
Keisuke Kuroyanagi 96a0631664 DynamicPatriciaTrieWritingUtils to write PtNodes.
Bug: 6669677
Change-Id: I67cce3c1d338cf747ed2204c96768907d990d269
2013-09-05 20:12:56 +09:00
Keisuke Kuroyanagi 2a41a35635 Add code point writing methods for updatable dictionaries.
Bug: 6669677
Change-Id: If7ab6fefdb9a7f0d21c397edbb7d9e7fddc0e0db
2013-09-05 14:24:07 +09:00
Keisuke Kuroyanagi 5901b5e1bd Check usesForgettingCurve in HeaderPolicy.
Bug: 6669677
Change-Id: I47ebfc50f477b2a6514fba6fad421dd90f29ecb1
2013-09-05 12:28:38 +09:00
Keisuke Kuroyanagi 91486bdb3d Merge "Employ a header attribute map in headerPolicy." 2013-09-04 10:06:05 +00:00
Keisuke Kuroyanagi 5754817a5e Employ a header attribute map in headerPolicy.
Bug: 6669677
Change-Id: I4a084cdd7fcd7a8ed3a70fb7e365031eedd981e5
2013-09-04 19:00:53 +09:00
Keisuke Kuroyanagi 5d8fd5457d Change name of bigram_list_reading_utils.* .
Bug: 6669677
Change-Id: Ifd2baa11fb4ee083be1d23e8235f6f903c1b5747
2013-09-03 20:44:58 +09:00
Keisuke Kuroyanagi 202e416b51 Add bigram writing methods.
Bug: 6669677

Change-Id: Ib62f6c31c4bcbb41ac200dccccb13e366b3c2173
2013-09-03 20:44:51 +09:00
Keisuke Kuroyanagi 9e3082e016 Add DynamicShortcutListPolicy::copyAllShortcuts().
Bug: 6669677
Change-Id: I74959fe3ca59d77ba0279c75f4d72db13735322f
2013-09-03 18:36:53 +09:00
Keisuke Kuroyanagi f1cd7a081c Implement reading side of updating methods of dpt.
Reading methods are used to determine the position to
be updated in dynamic patricia trie.

Bug: 6669677

Change-Id: Ie9acdcdbc73aa3fd4294c97aa39451a96b165ed9
2013-09-03 14:47:30 +09:00
Keisuke Kuroyanagi 75d1cb667d Add buffer writing methods.
Bug: 6669677

Change-Id: Ic3345e36a7842b77598c21de9b54f7c2863df38f
2013-09-02 19:27:01 +09:00
Keisuke Kuroyanagi 2660f83a12 Change name of extendable_buffer.h to buffer_with_... .
Bug: 6669677

Change-Id: Id2bd79d8f86c690d5c16d1ab726c5f6fa28ba5e3
2013-09-02 17:18:41 +09:00
Keisuke Kuroyanagi 3e76487c6c Consolidating dict buffers into BufferWithExtendableBuffer.
Bug: 6669677

Change-Id: Ied58c123b68199bddb91293ff5cf5d96691e1f6b
2013-09-02 17:18:41 +09:00
Keisuke Kuroyanagi 4d814bfcb7 Introduce DynamicPatriciaTrieReadingHelper.
It supports iterating nodes and dealing with additional
buffer. It counts nodes and node arrays to avoid infinite
loop.

Bug: 6669677

Change-Id: I322e7263c0535e098635a1e5de098838de09467d
2013-08-30 19:41:58 +09:00
Keisuke Kuroyanagi 69ebca0643 Fix children position reading for dynamic patricia trie.
Bug: 6669677
Change-Id: I68ad68361676f952bd25903c253c22617d3ce361
2013-08-29 18:31:15 +09:00
Keisuke Kuroyanagi 6c4d09e9e1 Use extendable buffer for reading node info.
Bug: 6669677
Change-Id: I78ba80100e3a38f2b49e43db1e6aef4e56ed062c
2013-08-27 18:06:42 +09:00
Keisuke Kuroyanagi 2f0c1253e2 Use extendable buffer for reading bigram and shortcut.
Bug: 6669677

Change-Id: I4017c0ecc5d8baff1b16ff370d3eec85de9a0f9f
2013-08-27 17:48:04 +09:00
Keisuke Kuroyanagi 27b12933cd Rename CharGroup to PtNode in native code.
Bug: 10233675
Change-Id: I5a4215cc79b37bfd317e60101e06b2ab9c332653
2013-08-26 14:51:43 +09:00
Keisuke Kuroyanagi ad4e0108a9 Fix: reading uninitialized area.
Bug: 10402083
Change-Id: I083beea29fe563b1e7739653d756b77820753e3f
2013-08-23 19:55:55 +09:00
Satoshi Kataoka 02833d11c3 Fix the autocorrection normalized score calculation
Bug: 10441240
Change-Id: I256021dc55481960d6a605046daa17b1a2d55b95
2013-08-23 16:22:02 +09:00
Keisuke Kuroyanagi 941811cbd6 Introduce ExtendableBuffer for dynamic update.
Bug: 6669677

Change-Id: I6343c348334c0dace8b12a71eb992d6f040e8c95
2013-08-22 18:05:15 +09:00
Keisuke Kuroyanagi a72a33388f Fix native crash by caused wrong munmap.
Bug: 10402083
Change-Id: I5aa2cecd20cd3202c2326b1cbb6758257afd6d5d
2013-08-21 18:57:58 +09:00
Yuichiro Hanada 112257e40f Rename BinaryDictDecoder to Ver3DictDecoder.
Change-Id: Ibf9b95b658df6e2c2218bdb62e2380f326a03832
2013-08-20 17:11:51 +09:00
Keisuke Kuroyanagi 4a65258bc7 Fix possible SIGSEGV.
Change-Id: I6008c0457a8da9b90434a3b96a51da1487948f1b
2013-08-19 18:58:10 +09:00
Keisuke Kuroyanagi 381c12df20 Move methods in BinaryFormat to PatriciaTriePolicy.
Bug: 6669677

Change-Id: Ic9bc03a9d8ec789281d83d4b9e58042a083c3ba1
2013-08-16 16:42:17 +09:00
Keisuke Kuroyanagi 0624cc6cf3 Remove BinaryDictionaryInfo and introduce MmapedBuffer.
Bug: 6669677
Change-Id: I70e47fa20109060b6ea7a04bcc42ab8f7c543f77
2013-08-16 12:52:04 +09:00
Ken Wakasa 0238e1eb01 Merge "Revert "Remove BinaryDictionaryInfo and introduce MmapedBuffer."" 2013-08-15 11:39:08 +00:00
Ken Wakasa d4fcf1dbc5 Revert "Remove BinaryDictionaryInfo and introduce MmapedBuffer."
This reverts commit d14ffcfcbc.

This broke a bunch of unit tests -- https://sponge.corp.google.com/target?id=a8a62bd0-3aab-4520-ae64-53f9652ef64b&target=com.google.android.inputmethod.latin.tests&searchFor=&show=FAILED&sortBy=STATUS

Change-Id: I1eae460e09808513eacefd523609330819d73d16
2013-08-15 11:37:48 +00:00
Yuichiro Hanada 94460eba11 [Refactor] Divide BinaryDictInputOutput into BinaryDictEncoder and BinaryDictDecoder.
Change-Id: I7c3269d77e3e3b567e459dcaa1bc029903941744
2013-08-15 20:23:07 +09:00
Keisuke Kuroyanagi 0663bc047b Merge "Remove BinaryDictionaryInfo and introduce MmapedBuffer." 2013-08-15 09:34:28 +00:00
Keisuke Kuroyanagi d14ffcfcbc Remove BinaryDictionaryInfo and introduce MmapedBuffer.
Bug: 6669677

Change-Id: I1459bb53a9761d920427e4b5d925a2844955c88c
2013-08-15 18:17:44 +09:00
Jean Chalard e7870a2c0d Add an initial JNI interface to dicttool.
Bug: 10100269
Change-Id: I883992c2033e7d9e7c754c0bf653767728b221b6
2013-08-15 17:58:55 +09:00
Ken Wakasa dc83fe37ba Merge "Revert "[Refactor] Divide BinaryDictInputOutput into BinaryDictInputUtils and BinaryDictOutputUtils."" 2013-08-15 08:56:28 +00: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
Ken Wakasa f74ddfbb06 Merge "[Refactor] Divide BinaryDictInputOutput into BinaryDictInputUtils and BinaryDictOutputUtils." 2013-08-15 06:53:23 +00:00
Yuichiro Hanada 4c63d0614e [Refactor] Divide BinaryDictInputOutput into BinaryDictInputUtils and BinaryDictOutputUtils.
Change-Id: I0d476abe763c11ba9005152f928e8dccf15ac9de
2013-08-15 15:46:58 +09:00
Keisuke Kuroyanagi 08ce337d3f Fix: BinaryDictionaryInfo.isDynamicallyUpdatable().
Change-Id: Ifb3acded5e19f1302c7fcc8881b74addd20c1571
2013-08-15 13:39:32 +09:00
Keisuke Kuroyanagi 6ec3f63d59 Merge "Make dictionary structure policy have updating methods." 2013-08-15 03:15:43 +00:00
Yuichiro Hanada 46ebaa49e9 Fix a comment.
Change-Id: I5d09fd2474c7a0e6f42b6c7c6e717692636fbc6d
2013-08-15 11:57:58 +09:00
Keisuke Kuroyanagi 7fd9667d76 Remove NodeFilter.
Change-Id: I27d905dd3581cbb0e67d071dba04066aaa2ba22e
2013-08-14 18:20:15 +09:00
Keisuke Kuroyanagi dfecc86f25 Fix ShortcutListPolicy::getStartPos().
Bug: 6669677
Change-Id: I1fa9967fc6aa0956986954c8ea1f990a47c15764
2013-08-14 17:23:57 +09:00
Keisuke Kuroyanagi 90619ae02b Move utils for reading dict to policyimpl.
Bug: 6669677
Change-Id: Ia1da3cb84b457665cf26172d3810e1d28329bca4
2013-08-14 15:50:42 +09:00
Keisuke Kuroyanagi 66facd37dd Make dictionary structure policy have updating methods.
Bug: 6669677

Change-Id: I6aa8e377c6347e0db4b7a82293b316ec64d87bec
2013-08-14 11:34:42 +09:00
Keisuke Kuroyanagi 23d3ed962f Move files for headerPolicy to policyimpl.
Bug: 6669677
Change-Id: Ic90feb9c3a9a7b698e588c8ad25c765a246706a8
2013-08-13 20:35:16 +09:00
Keisuke Kuroyanagi 76e579c7ca Move header reading methods to policyimpl.
Bug: 6669677
Change-Id: I24cb32f28cf355485b431cc56d877000e3f946d4
2013-08-13 20:22:40 +09:00
Keisuke Kuroyanagi d81654cd61 Use DictionaryStructureWithBufferPolicy for traversing.
Bug: 6669677
Change-Id: If7bc038278b7217ed5ba4cb77b1238b2dad0001b
2013-08-13 19:38:20 +09:00
Keisuke Kuroyanagi e607e0722a Merge "Remove TerminalAttributes." 2013-08-13 05:58:35 +00:00
Keisuke Kuroyanagi b40d14226b Merge "Quit using BinaryDictionaryInfo in header reading methods." 2013-08-13 05:49:49 +00:00
Keisuke Kuroyanagi 99007de979 Quit using BinaryDictionaryInfo in header reading methods.
Bug: 6669677
Change-Id: I5198ae28fcc271dd6ab3c33df940a2d15513a8c8
2013-08-13 12:26:01 +09:00
Keisuke Kuroyanagi 6abdafc671 Remove TerminalAttributes.
Use BinaryDictionaryShortcutIterator instead of
TerminalAttributes.

Bug: 6669677
Change-Id: Ib7176e3b302ba383344cc6fcc037e23568c702a8
2013-08-12 17:46:13 +09:00
Keisuke Kuroyanagi f4688f8df0 Cleanup ShortcutListReadingUtils.
Bug: 6669677
Change-Id: Ifd61022665c89f492933dde9811ec644f7e1f5c4
2013-08-12 17:46:13 +09:00
Keisuke Kuroyanagi f1e383ed45 Change name of shortcut reading util class.
Bug: 6669677
Change-Id: If93916f4c3d568119ff6b83e22e95c7086423d2f
2013-08-12 17:37:59 +09:00
Keisuke Kuroyanagi 7c48352af8 Move methods for Shortcut reading to policyimpl.
Bug: 6669677
Change-Id: If0a565de015564f803429f4fbf21b05687f80553
2013-08-12 17:18:28 +09:00
Keisuke Kuroyanagi fd10db04e0 Move shortcut iteration methods to poilcy.
Bug: 6669677
Change-Id: I6e535ce7962de8e153a52fd1085fe961649ffe16
2013-08-12 15:53:09 +09:00
Keisuke Kuroyanagi 277053af7c Move bigram reading methods to BigramListReadingUtils.
Bug: 6669677
Change-Id: Icb024a8af577323b4dcf74f4c4054cfb8b57a943
2013-08-12 11:54:31 +09:00
Keisuke Kuroyanagi 668870be43 Move bigrams iteration methods to policy.
To support various bigram format.

Bug: 6669677
Change-Id: Ifc8c1a855b03cd5a39d97a6e10872ef8ef76475b
2013-08-09 20:20:34 +09:00
Keisuke Kuroyanagi e1ebef6124 Make DictionaryStructurePolicy have buffer info.
To support various format dictionary, extendable
buffers or multiple files.

Bug: 6669677
Change-Id: I203a5a4adc049a6322cfba4eacb4cb6715f8dfc2
2013-08-09 05:27:22 +00:00
Keisuke Kuroyanagi b2408c7f71 Fix parent position reading for ver3 dict.
Bug: 6669677
Change-Id: Ia55d4ecb43c7d37b9bc466b848d5142bc13cd823
2013-08-08 16:31:17 +09:00
Keisuke Kuroyanagi 60eb250194 Support ver3 dict in native code.
Bug: 6669677
Change-Id: Iafc3287f1f87588a6296593d6b43ea4464c8f553
2013-08-08 14:53:05 +09:00
Keisuke Kuroynagi 744084defb Implement getTerminalNodePositionOfWord for ver3 dict.
Bug: 6669677

Change-Id: Ib9f88d23e6502b8281921ae2f1e47f930b16972f
2013-08-07 17:59:52 +09:00
Keisuke Kuroynagi 9601df5aac Implement getCodePointsAndProbabilityAnd... for ver3 dicts.
Bug: 6669677
Change-Id: I5c3b53d015496e11cb6c1f19938b8ee8a4c0f983
2013-08-07 11:53:34 +09:00
Keisuke Kuroynagi 2b1dd6e253 Implement a part of ver 3 dictionary reading methods.
Bug: 6669677
Change-Id: I83c159838ad99b2093907b9de7df6cb7a97b4165
2013-08-06 10:18:20 +09:00
Keisuke Kuroynagi 22f951c881 Merge "Remove checkFirstCharacter from BigramDictionary." 2013-08-05 04:56:23 +00:00
Keisuke Kuroynagi cf1f7675ea DynamicPatriciaTrieReadingUtils for version 3 dictionary.
Bug: 6669677
Change-Id: I7105258a00159a5ddda7ff520c490c4ac9fa7902
2013-08-01 16:15:49 +09:00
Keisuke Kuroynagi 647c000707 Give PatriciaTrieReadingUtils methods for reading nodes.
The remaining methods in BinaryFormat will be removed.

Bug: 6669677
Change-Id: I866f828d69a600c0ac03b68d71b1f6ee2ce4dd36
2013-08-01 16:15:35 +09:00
Keisuke Kuroynagi f0a7f70cf6 Fix: Include wrong file in dynamic_patricia_trie_policy.cpp.
Change-Id: If994f17e41c7d07e979fa6b0aa4661da0523eb0a
2013-08-01 14:48:20 +09:00
Keisuke Kuroynagi 8045b7cd24 Merge "Introduce DynamicPatriciaTriePolicy for ver 3 dictionary." 2013-08-01 05:39:07 +00:00
Keisuke Kuroynagi 2401f7c62d Move binary_format.h to policyimpl.
Bug: 6669677
Change-Id: I3712f60528c7fcf364746f792cec6e180ab2dbef
2013-07-31 21:07:32 +09:00
Keisuke Kuroynagi 11a431fca6 Fix: appendTwoWords cannot handle MAX_WORD_LENGTH-chars word.
Bug: 9892258
Change-Id: Ib4ef7850c8fc8b1d99d594bb7ef68ce645f0f1f3
2013-07-31 16:58:09 +09:00
Keisuke Kuroynagi 2a2aac2568 Remove checkFirstCharacter from BigramDictionary.
Bug: 10028452
Change-Id: I27b147e83b312d73e975a0b2bc8074b33906e56e
2013-07-31 13:47:23 +09:00
Keisuke Kuroynagi 26de7079b6 Introduce DynamicPatriciaTriePolicy for ver 3 dictionary.
Bug: 6669677
Change-Id: Idd3189558aa6fbbd6b2fd007c5721bf39dde9f48
2013-07-30 17:41:13 +09:00
Keisuke Kuroynagi 1fb11da36a Move creating children methods to structurePolicy.
Bug: 6669677
Change-Id: I20760f8ab95b18d21383960f6466db0d79429200
2013-07-29 19:31:27 +09:00
Keisuke Kuroynagi 9d618d1431 Move files only used in dicNode to "internal".
Change-Id: Ib31ddeff99b480d9b1f33a5b5b207a8acce22858
2013-07-29 17:03:21 +09:00
Keisuke Kuroynagi 4447b14b78 "much" in suggestions of "m" after "very"
Make cache size larger for single point input.

Bug: 9823678
Change-Id: Ic6bbcebd18eccaf9f9ac07d9c0d456a62f6c5287
2013-07-26 18:35:42 +09:00
Satoshi Kataoka 75322cecb9 Support terminal insertion error correction
Bug: 9421356

Change-Id: I19685763ca487b5636019d62e150708c63ce6fc2
2013-07-25 22:07:38 +09:00
Keisuke Kuroynagi cb4a7c1d87 Fix: "saomething" -> "something".
Fixed by making MAX_CACHE_DIC_NODE_SIZE larger.

Bug: 9682742

Change-Id: I0312952c90b0820bed37df99c223921c68450570
2013-07-24 17:55:25 +09:00
Keisuke Kuroynagi 62f3b4e9c9 Merge "Fix: huge bigram costs for blacklisted words." 2013-07-23 05:32:09 +00:00
Keisuke Kuroynagi 5b7688bbb5 Fix: native crash while iterating bigramslist.
Bug: 9964153
Change-Id: Ia2eb922b61300a7c0e34122cd6c18358f1ee7ba9
2013-07-23 13:13:12 +09:00
Keisuke Kuroynagi b179199830 Fix: huge bigram costs for blacklisted words.
Bug: 8844931
Change-Id: I523005c5ed9a3d401a67b0e4e1c3ff2e4574e6df
2013-07-22 22:05:16 +09:00
Keisuke Kuroynagi c38ec47596 Get BigramsPos and ShortcutPos via structure policy.
Bug: 6669677
Change-Id: I924d5512377cfcfe72d3470006b81a36db3865b6
2013-07-17 20:13:04 +09:00
Keisuke Kuroynagi 8a7129530b Replace NOT_VALID_WORD with NOT_A_VALID_WORD_POS
Bug: 6669677
Change-Id: If5fb58e8a98b04b767eaaf624cb6a40841b64f54
2013-07-16 15:53:03 +09:00
Keisuke Kuroynagi b6f286bfa5 Merge "Make bigram dictionary and traverse session use structure policy." 2013-07-16 02:45:36 +00:00
Keisuke Kuroynagi 34047d8905 Quit ignoring language cost of exact matches.
Handle exact matches in DicNode::compare() and calculateFinalScore().

Bug: 8844931
Change-Id: I17c78d4e352b0a4308727229b02a8004b38468bf
2013-07-11 08:25:17 +00:00
Keisuke Kuroynagi 1311cdcb62 Make bigram dictionary and traverse session use structure policy.
Bug: 6669677
Change-Id: I5a13290366afbb788da997b98d1c593963e92f3e
2013-07-08 14:25:50 +09:00
Keisuke Kuroynagi 5b03213db1 Remove flags from dicNodeProperties.
Bug: 6669677
Change-Id: I6f4aef8c4e4376f078ed8375394823788aa35002
2013-07-05 16:35:07 +09:00
Keisuke Kuroynagi 0933353c0c Merge "Read version 3 dictionary header." 2013-07-04 14:19:35 +00:00
Keisuke Kuroynagi cac66f29eb Merge "Return NOT_A_PROBABILITY in getProbability for inalid dictionary." 2013-07-04 09:59:40 +00:00
Keisuke Kuroynagi a829188f54 Allow force auto commit when the top is long multiword.
Bug: 9688196
Change-Id: I73ff2cd77b932bf7307b3541ea9da3fa4afa11b4
2013-07-04 17:39:01 +09:00
Keisuke Kuroynagi 72f69fd621 Return NOT_A_PROBABILITY in getProbability for inalid dictionary.
Bug: 9682742
Change-Id: Ifad4b9811bb5e1a94aed59eba7aedcdb6da5cf9c
2013-07-03 20:12:38 +09:00
Keisuke Kuroynagi 9a4f7a3761 Disable shortcut output for multi-word suggestions.
Bug: 9682742
Change-Id: I9e0a5acd9053d141e018c4653e4baf0f77aacb45
2013-07-03 17:22:36 +09:00
Keisuke Kuroynagi 5ae8722bd5 Read version 3 dictionary header.
The header structure of version 3 dictionary is same as version 2.

Bug: 6669677
Change-Id: I26c8723333938fbf102de1a40f11d97444da9075
2013-07-03 17:10:48 +09:00