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

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

Issue 553087: The first step towards supporting the Hungarian spell-checking dictionary.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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 | « chrome/chrome_tests.gypi ('k') | chrome/tools/convert_dict/convert_dict_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/tools/convert_dict/aff_reader.cc
===================================================================
--- chrome/tools/convert_dict/aff_reader.cc (revision 37777)
+++ chrome/tools/convert_dict/aff_reader.cc (working copy)
@@ -211,6 +211,23 @@
}
part = rule->substr(part_start); // From here to end.
+ if (part.find('-') != std::string::npos) {
+ // This rule has a morph rule used by old Hungarian dictionaries.
+ // When a line has a morph rule, its format becomes as listed below.
+ // AFX D 0 d e - M
+ // To make hunspell work more happily, replace this morph rule with
+ // a compound flag as listed below.
+ // AFX D 0 d/M e
+ std::vector<std::string> tokens;
+ SplitString(part, ' ', &tokens);
+ if (tokens.size() >= 5) {
+ part = StringPrintf("%s %s/%s %s",
+ tokens[0].c_str(),
+ tokens[1].c_str(), tokens[4].c_str(),
+ tokens[2].c_str());
+ }
+ }
+
size_t slash_index = part.find('/');
if (slash_index != std::string::npos && !has_indexed_affixes()) {
// This can also have a rule string associated with it following a
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/tools/convert_dict/convert_dict_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698