Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(420)

Unified Diff: chrome/third_party/hunspell/google/bdict_writer.cc

Issue 18041: The first step towards Turkish spell-checker.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/third_party/hunspell/src/hunspell/hashmgr.cxx » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/third_party/hunspell/google/bdict_writer.cc
===================================================================
--- chrome/third_party/hunspell/google/bdict_writer.cc (revision 9076)
+++ chrome/third_party/hunspell/google/bdict_writer.cc (working copy)
@@ -161,9 +161,17 @@
// The additional affix list holds affixes when there is more than one. Each
// entry is two bytes, plus an additional FFFF terminator.
size_t supplimentary_size = 0;
- if (node->affix_indices.size() > 1 ||
- node->affix_indices[0] > BDict::LEAF_NODE_MAX_FIRST_AFFIX_ID)
+ if (node->affix_indices[0] > BDict::LEAF_NODE_MAX_FIRST_AFFIX_ID) {
+ // We cannot store the first affix ID of the affix list into a leaf node.
+ // In this case, we have to store all the affix IDs and a terminator
+ // into a supplimentary list.
+ supplimentary_size = node->affix_indices.size() * 2 + 2;
+ } else if (node->affix_indices.size() > 1) {
+ // We can store the first affix ID of the affix list into a leaf node.
+ // In this case, we need to store the remaining affix IDs and a
+ // terminator into a supplimentary list.
supplimentary_size = node->affix_indices.size() * 2;
+ }
if (node->leaf_addition.empty()) {
node->storage = DicNode::LEAF;
« no previous file with comments | « no previous file | chrome/third_party/hunspell/src/hunspell/hashmgr.cxx » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698