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

Unified Diff: chrome/tools/convert_dict/dic_reader.cc

Issue 11566003: Bump dictionary versions to 3-0 (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix android compile Created 8 years 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 | « chrome/tools/convert_dict/aff_reader.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/tools/convert_dict/dic_reader.cc
diff --git a/chrome/tools/convert_dict/dic_reader.cc b/chrome/tools/convert_dict/dic_reader.cc
index 967f07e5d4480e957cbeec10bde3f609b3380d78..5ed5cfaedd5e40d405372c90b83cb039bde0ecf0 100644
--- a/chrome/tools/convert_dict/dic_reader.cc
+++ b/chrome/tools/convert_dict/dic_reader.cc
@@ -117,13 +117,10 @@ bool PopulateWordSet(WordSet* word_set, FILE* file, AffReader* aff_reader,
std::set<int> affix_vector;
affix_vector.insert(affix_index);
- if (found == word_set->end()) {
+ if (found == word_set->end())
word_set->insert(std::make_pair(utf8word, affix_vector));
- } else {
- // The affixes of the delta file should override those in the
- // dictionary file.
- found->second.swap(affix_vector);
- }
+ else
+ found->second.insert(affix_index);
}
return true;
@@ -170,7 +167,6 @@ bool DicReader::Read(AffReader* aff_reader) {
PopulateWordSet(&word_set, additional_words_file_, aff_reader, "dic delta",
"UTF-8", false);
}
-
// Make sure the words are sorted, they may be unsorted in the input.
for (WordSet::iterator word = word_set.begin(); word != word_set.end();
++word) {
@@ -182,6 +178,7 @@ bool DicReader::Read(AffReader* aff_reader) {
// Double check that the affixes are sorted. This isn't strictly necessary
// but it's nice for the file to have a fixed layout.
std::sort(affixes.begin(), affixes.end());
+ std::reverse(affixes.begin(), affixes.end());
words_.push_back(std::make_pair(word->first, affixes));
}
« no previous file with comments | « chrome/tools/convert_dict/aff_reader.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698