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

Unified Diff: chrome/third_party/hunspell/src/hunspell/hashmgr.cxx

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
Index: chrome/third_party/hunspell/src/hunspell/hashmgr.cxx
===================================================================
--- chrome/third_party/hunspell/src/hunspell/hashmgr.cxx (revision 9076)
+++ chrome/third_party/hunspell/src/hunspell/hashmgr.cxx (working copy)
@@ -559,29 +559,34 @@
{
utf8 = 1; // We always use UTF-8.
- // Read in all the AF lines which tell us the rules for each affix group ID.
+ // Read in the regular commands from the affix file. We care about the FLAG
+ // line becuase the AF lines depend on this value, and the IGNORE line.
+ // The rest of the commands will be read by the affix manager.
char line[MAXDELEN+1];
- hunspell::LineIterator iterator = bdict_reader->GetAfLineIterator();
+ hunspell::LineIterator iterator = bdict_reader->GetOtherLineIterator();
while (iterator.AdvanceAndCopy(line, MAXDELEN)) {
- int rv = parse_aliasf(line, &iterator);
- if (rv)
- return rv;
- }
-
- // Read in the regular commands from the affix file. We only care about the
- // IGNORE line here. The rest of the commands will be read by the affix
- // manager.
- iterator = bdict_reader->GetOtherLineIterator();
- while (iterator.AdvanceAndCopy(line, MAXDELEN)) {
// Parse in the ignored characters (for example, Arabic optional
// diacritics characters.
if (strncmp(line,"IGNORE",6) == 0) {
parse_array(line, &ignorechars, &ignorechars_utf16,
&ignorechars_utf16_len, "IGNORE", utf8);
- break; // All done.
}
+ // Retrieve the format of an AF line.
+ if ((strncmp(line,"FLAG",4) == 0) && isspace(line[4])) {
+ if (strstr(line, "long")) flag_mode = FLAG_LONG;
+ if (strstr(line, "num")) flag_mode = FLAG_NUM;
+ if (strstr(line, "UTF-8")) flag_mode = FLAG_UNI;
+ }
}
+ // Read in all the AF lines which tell us the rules for each affix group ID.
+ iterator = bdict_reader->GetAfLineIterator();
+ while (iterator.AdvanceAndCopy(line, MAXDELEN)) {
+ int rv = parse_aliasf(line, &iterator);
+ if (rv)
+ return rv;
+ }
+
return 0;
}
#else
« no previous file with comments | « chrome/third_party/hunspell/google/bdict_writer.cc ('k') | chrome/third_party/hunspell/src/hunspell/htypes.hxx » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698