diff options
author | rlp@chromium.org <rlp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-27 02:33:07 +0000 |
---|---|---|
committer | rlp@chromium.org <rlp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-27 02:33:07 +0000 |
commit | 4911a428fdd574c3edfe35e338cc94f0ebc67c10 (patch) | |
tree | 69016c8fb0c0c564912209785932fa569255dc29 /chrome/tools/convert_dict/dic_reader.cc | |
parent | dcdac2003884df9a566a3c62c3310873e17e1004 (diff) | |
download | chromium_src-4911a428fdd574c3edfe35e338cc94f0ebc67c10.zip chromium_src-4911a428fdd574c3edfe35e338cc94f0ebc67c10.tar.gz chromium_src-4911a428fdd574c3edfe35e338cc94f0ebc67c10.tar.bz2 |
Fixing the hunspell convert_dict tool to replace the affixes from the .dic file with those from the .dic_delta file.
As it stands right now, they are added to the set, but do not make a difference in the actual interpretation. From testing, there is only ever one indexed affix per word so replacing it with the most recent (i.e., the one from the .dic_delta file) is what we want.
The understanding being that if you want to change the affix, you would just add the word to the .dic_delta file with the new affixes you want.
BUG=160847
TBR=sky@chromium.org
Review URL: https://chromiumcodereview.appspot.com/11419044
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169559 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/tools/convert_dict/dic_reader.cc')
-rw-r--r-- | chrome/tools/convert_dict/dic_reader.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/chrome/tools/convert_dict/dic_reader.cc b/chrome/tools/convert_dict/dic_reader.cc index 7b13abc..967f07e 100644 --- a/chrome/tools/convert_dict/dic_reader.cc +++ b/chrome/tools/convert_dict/dic_reader.cc @@ -114,12 +114,15 @@ bool PopulateWordSet(WordSet* word_set, FILE* file, AffReader* aff_reader, utf8word = utf8word.substr(0, word_tab_offset); WordSet::iterator found = word_set->find(utf8word); + std::set<int> affix_vector; + affix_vector.insert(affix_index); + if (found == word_set->end()) { - std::set<int> affix_vector; - affix_vector.insert(affix_index); word_set->insert(std::make_pair(utf8word, affix_vector)); } else { - found->second.insert(affix_index); + // The affixes of the delta file should override those in the + // dictionary file. + found->second.swap(affix_vector); } } |