| Index: third_party/hunspell128/src/hunspell/affixmgr.cxx
|
| ===================================================================
|
| --- third_party/hunspell128/src/hunspell/affixmgr.cxx (revision 24436)
|
| +++ third_party/hunspell128/src/hunspell/affixmgr.cxx (working copy)
|
| @@ -116,15 +116,18 @@
|
| }
|
|
|
| #ifdef HUNSPELL_CHROME_CLIENT
|
| - if (parse_file()) {
|
| + // Define dummy parameters for parse_file() to avoid changing the parameters
|
| + // of parse_file(). This may make it easier to merge the changes of the
|
| + // original hunspell.
|
| + FILE* affpath = NULL;
|
| + const char* key = NULL;
|
| #else
|
| -
|
| for (int j=0; j < CONTSIZE; j++) {
|
| contclasses[j] = 0;
|
| }
|
| +#endif
|
|
|
| if (parse_file(affpath, key)) {
|
| -#endif
|
| HUNSPELL_WARNING(stderr, "Failure loading aff file\n");
|
| }
|
|
|
| @@ -264,13 +267,9 @@
|
|
|
|
|
| // read in aff file and build up prefix and suffix entry objects
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| -int AffixMgr::parse_file()
|
| -#else
|
| int AffixMgr::parse_file(FILE* aff_handle, const char * key)
|
| -#endif
|
| {
|
| - char * line = new char[MAXLNLEN+1]; // io buffers
|
| + char * line; // io buffers
|
| char ft; // affix type
|
|
|
| // open the affix file
|
| @@ -278,22 +277,37 @@
|
| // We're always UTF-8
|
| utf8 = 1;
|
|
|
| - hunspell::LineIterator af_iterator = bdict_reader->GetAffixLineIterator();
|
| - while (af_iterator.AdvanceAndCopy(line, MAXLNLEN)) {
|
| + // A BDICT file stores PFX and SFX lines in a special section and it provides
|
| + // a special line iterator for reading PFX and SFX lines.
|
| + // We create a FileMgr object from this iterator and parse PFX and SFX lines
|
| + // before parsing other lines.
|
| + hunspell::LineIterator affix_iterator = bdict_reader->GetAffixLineIterator();
|
| + FileMgr* iterator = new FileMgr(&affix_iterator);
|
| + if (!iterator) {
|
| + HUNSPELL_WARNING(stderr,
|
| + "error: could not create a FileMgr from an affix line iterator.\n");
|
| + return 1;
|
| + }
|
| +
|
| + while (line = iterator->getline()) {
|
| ft = ' ';
|
| if (strncmp(line,"PFX",3) == 0) ft = complexprefixes ? 'S' : 'P';
|
| if (strncmp(line,"SFX",3) == 0) ft = complexprefixes ? 'P' : 'S';
|
| if (ft != ' ')
|
| - parse_affix(line, ft, &af_iterator);
|
| + parse_affix(line, ft, iterator, NULL);
|
| }
|
| + delete iterator;
|
|
|
| - hunspell::LineIterator iterator = bdict_reader->GetOtherLineIterator();
|
| -
|
| - // Hack to keep us from having to change all of the calls below which take
|
| - // a LineIterator* instead of a FILE* afflst.
|
| - hunspell::LineIterator* afflst = &iterator;
|
| -
|
| - while (iterator.AdvanceAndCopy(line, MAXLNLEN)) {
|
| + // Create a FileMgr object for reading lines except PFX and SFX lines.
|
| + // We don't need to change the loop below since our FileMgr emulates the
|
| + // original one.
|
| + hunspell::LineIterator other_iterator = bdict_reader->GetOtherLineIterator();
|
| + FileMgr * afflst = new FileMgr(&other_iterator);
|
| + if (!afflst) {
|
| + HUNSPELL_WARNING(stderr,
|
| + "error: could not create a FileMgr from an other line iterator.\n");
|
| + return 1;
|
| + }
|
| #else
|
| // checking flag duplication
|
| char dupflags[CONTSIZE];
|
| @@ -308,6 +322,7 @@
|
| HUNSPELL_WARNING(stderr, "error: could not open affix description file %s\n",affpath);
|
| return 1;
|
| }
|
| +#endif
|
|
|
| // step one is to parse the affix file building up the internal
|
| // affix data structures
|
| @@ -317,6 +332,7 @@
|
| while ((line = afflst->getline())) {
|
| mychomp(line);
|
|
|
| +#ifndef HUNSPELL_CHROME_CLIENT
|
| /* remove byte order mark */
|
| if (firstline) {
|
| firstline = 0;
|
| @@ -328,36 +344,24 @@
|
| #endif
|
| /* parse in the keyboard string */
|
| if (strncmp(line,"KEY",3) == 0) {
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| - if (parse_string(line, &keystring, 0)) {
|
| -#else
|
| if (parse_string(line, &keystring, afflst->getlinenum())) {
|
| delete afflst;
|
| -#endif
|
| return 1;
|
| }
|
| }
|
|
|
| /* parse in the try string */
|
| if (strncmp(line,"TRY",3) == 0) {
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| - if (parse_string(line, &trystring, 0)) {
|
| -#else
|
| if (parse_string(line, &trystring, afflst->getlinenum())) {
|
| delete afflst;
|
| -#endif
|
| return 1;
|
| }
|
| }
|
|
|
| /* parse in the name of the character set used by the .dict and .aff */
|
| if (strncmp(line,"SET",3) == 0) {
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| - if (parse_string(line, &encoding, 0)) {
|
| -#else
|
| if (parse_string(line, &encoding, afflst->getlinenum())) {
|
| delete afflst;
|
| -#endif
|
| return 1;
|
| }
|
| if (strcmp(encoding, "UTF-8") == 0) {
|
| @@ -376,12 +380,8 @@
|
|
|
| /* parse in the flag used by the controlled compound words */
|
| if (strncmp(line,"COMPOUNDFLAG",12) == 0) {
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| - if (parse_flag(line, &compoundflag)) {
|
| -#else
|
| if (parse_flag(line, &compoundflag, afflst)) {
|
| delete afflst;
|
| -#endif
|
| return 1;
|
| }
|
| }
|
| @@ -389,21 +389,13 @@
|
| /* parse in the flag used by compound words */
|
| if (strncmp(line,"COMPOUNDBEGIN",13) == 0) {
|
| if (complexprefixes) {
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| - if (parse_flag(line, &compoundend)) {
|
| -#else
|
| if (parse_flag(line, &compoundend, afflst)) {
|
| delete afflst;
|
| -#endif
|
| return 1;
|
| }
|
| } else {
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| - if (parse_flag(line, &compoundbegin)) {
|
| -#else
|
| if (parse_flag(line, &compoundbegin, afflst)) {
|
| delete afflst;
|
| -#endif
|
| return 1;
|
| }
|
| }
|
| @@ -411,33 +403,21 @@
|
|
|
| /* parse in the flag used by compound words */
|
| if (strncmp(line,"COMPOUNDMIDDLE",14) == 0) {
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| - if (parse_flag(line, &compoundmiddle)) {
|
| -#else
|
| if (parse_flag(line, &compoundmiddle, afflst)) {
|
| delete afflst;
|
| -#endif
|
| return 1;
|
| }
|
| }
|
| /* parse in the flag used by compound words */
|
| if (strncmp(line,"COMPOUNDEND",11) == 0) {
|
| if (complexprefixes) {
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| - if (parse_flag(line, &compoundbegin)) {
|
| -#else
|
| if (parse_flag(line, &compoundbegin, afflst)) {
|
| delete afflst;
|
| -#endif
|
| return 1;
|
| }
|
| } else {
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| - if (parse_flag(line, &compoundend)) {
|
| -#else
|
| if (parse_flag(line, &compoundend, afflst)) {
|
| delete afflst;
|
| -#endif
|
| return 1;
|
| }
|
| }
|
| @@ -445,48 +425,32 @@
|
|
|
| /* parse in the data used by compound_check() method */
|
| if (strncmp(line,"COMPOUNDWORDMAX",15) == 0) {
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| - if (parse_num(line, &cpdwordmax)) {
|
| -#else
|
| if (parse_num(line, &cpdwordmax, afflst)) {
|
| delete afflst;
|
| -#endif
|
| return 1;
|
| }
|
| }
|
|
|
| /* parse in the flag sign compounds in dictionary */
|
| if (strncmp(line,"COMPOUNDROOT",12) == 0) {
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| - if (parse_flag(line, &compoundroot)) {
|
| -#else
|
| if (parse_flag(line, &compoundroot, afflst)) {
|
| delete afflst;
|
| -#endif
|
| return 1;
|
| }
|
| }
|
|
|
| /* parse in the flag used by compound_check() method */
|
| if (strncmp(line,"COMPOUNDPERMITFLAG",18) == 0) {
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| - if (parse_flag(line, &compoundpermitflag)) {
|
| -#else
|
| if (parse_flag(line, &compoundpermitflag, afflst)) {
|
| delete afflst;
|
| -#endif
|
| return 1;
|
| }
|
| }
|
|
|
| /* parse in the flag used by compound_check() method */
|
| if (strncmp(line,"COMPOUNDFORBIDFLAG",18) == 0) {
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| - if (parse_flag(line, &compoundforbidflag)) {
|
| -#else
|
| if (parse_flag(line, &compoundforbidflag, afflst)) {
|
| delete afflst;
|
| -#endif
|
| return 1;
|
| }
|
| }
|
| @@ -512,96 +476,64 @@
|
| }
|
|
|
| if (strncmp(line,"NOSUGGEST",9) == 0) {
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| - if (parse_flag(line, &nosuggest)) {
|
| -#else
|
| if (parse_flag(line, &nosuggest, afflst)) {
|
| delete afflst;
|
| -#endif
|
| return 1;
|
| }
|
| }
|
|
|
| /* parse in the flag used by forbidden words */
|
| if (strncmp(line,"FORBIDDENWORD",13) == 0) {
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| - if (parse_flag(line, &forbiddenword)) {
|
| -#else
|
| if (parse_flag(line, &forbiddenword, afflst)) {
|
| delete afflst;
|
| -#endif
|
| return 1;
|
| }
|
| }
|
|
|
| /* parse in the flag used by forbidden words */
|
| if (strncmp(line,"LEMMA_PRESENT",13) == 0) {
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| - if (parse_flag(line, &lemma_present)) {
|
| -#else
|
| if (parse_flag(line, &lemma_present, afflst)) {
|
| delete afflst;
|
| -#endif
|
| return 1;
|
| }
|
| }
|
|
|
| /* parse in the flag used by circumfixes */
|
| if (strncmp(line,"CIRCUMFIX",9) == 0) {
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| - if (parse_flag(line, &circumfix)) {
|
| -#else
|
| if (parse_flag(line, &circumfix, afflst)) {
|
| delete afflst;
|
| -#endif
|
| return 1;
|
| }
|
| }
|
|
|
| /* parse in the flag used by fogemorphemes */
|
| if (strncmp(line,"ONLYINCOMPOUND",14) == 0) {
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| - if (parse_flag(line, &onlyincompound)) {
|
| -#else
|
| if (parse_flag(line, &onlyincompound, afflst)) {
|
| delete afflst;
|
| -#endif
|
| return 1;
|
| }
|
| }
|
|
|
| /* parse in the flag used by `needaffixs' */
|
| if (strncmp(line,"PSEUDOROOT",10) == 0) {
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| - if (parse_flag(line, &needaffix)) {
|
| -#else
|
| if (parse_flag(line, &needaffix, afflst)) {
|
| delete afflst;
|
| -#endif
|
| return 1;
|
| }
|
| }
|
|
|
| /* parse in the flag used by `needaffixs' */
|
| if (strncmp(line,"NEEDAFFIX",9) == 0) {
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| - if (parse_flag(line, &needaffix)) {
|
| -#else
|
| if (parse_flag(line, &needaffix, afflst)) {
|
| delete afflst;
|
| -#endif
|
| return 1;
|
| }
|
| }
|
|
|
| /* parse in the minimal length for words in compounds */
|
| if (strncmp(line,"COMPOUNDMIN",11) == 0) {
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| - if (parse_num(line, &cpdmin)) {
|
| -#else
|
| if (parse_num(line, &cpdmin, afflst)) {
|
| delete afflst;
|
| -#endif
|
| return 1;
|
| }
|
| if (cpdmin < 1) cpdmin = 1;
|
| @@ -609,24 +541,16 @@
|
|
|
| /* parse in the max. words and syllables in compounds */
|
| if (strncmp(line,"COMPOUNDSYLLABLE",16) == 0) {
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| - if (parse_cpdsyllable(line)) {
|
| -#else
|
| if (parse_cpdsyllable(line, afflst)) {
|
| delete afflst;
|
| -#endif
|
| return 1;
|
| }
|
| }
|
|
|
| /* parse in the flag used by compound_check() method */
|
| if (strncmp(line,"SYLLABLENUM",11) == 0) {
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| - if (parse_string(line, &cpdsyllablenum, 0)) {
|
| -#else
|
| if (parse_string(line, &cpdsyllablenum, afflst->getlinenum())) {
|
| delete afflst;
|
| -#endif
|
| return 1;
|
| }
|
| }
|
| @@ -638,24 +562,16 @@
|
|
|
| /* parse in the extra word characters */
|
| if (strncmp(line,"WORDCHARS",9) == 0) {
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| - if (parse_array(line, &wordchars, &wordchars_utf16, &wordchars_utf16_len, utf8, 0)) {
|
| -#else
|
| if (parse_array(line, &wordchars, &wordchars_utf16, &wordchars_utf16_len, utf8, afflst->getlinenum())) {
|
| delete afflst;
|
| -#endif
|
| return 1;
|
| }
|
| }
|
|
|
| /* parse in the ignored characters (for example, Arabic optional diacretics charachters */
|
| if (strncmp(line,"IGNORE",6) == 0) {
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| - if (parse_array(line, &ignorechars, &ignorechars_utf16, &ignorechars_utf16_len, utf8, 0)) {
|
| -#else
|
| if (parse_array(line, &ignorechars, &ignorechars_utf16, &ignorechars_utf16_len, utf8, afflst->getlinenum())) {
|
| delete afflst;
|
| -#endif
|
| return 1;
|
| }
|
| }
|
| @@ -673,9 +589,7 @@
|
| /* parse in the input conversion table */
|
| if (strncmp(line,"ICONV",5) == 0) {
|
| if (parse_convtable(line, afflst, &iconvtable, "ICONV")) {
|
| -#ifndef HUNSPELL_CHROME_CLIENT
|
| delete afflst;
|
| -#endif
|
| return 1;
|
| }
|
| }
|
| @@ -683,9 +597,7 @@
|
| /* parse in the input conversion table */
|
| if (strncmp(line,"OCONV",5) == 0) {
|
| if (parse_convtable(line, afflst, &oconvtable, "OCONV")) {
|
| -#ifndef HUNSPELL_CHROME_CLIENT
|
| delete afflst;
|
| -#endif
|
| return 1;
|
| }
|
| }
|
| @@ -693,9 +605,7 @@
|
| /* parse in the phonetic translation table */
|
| if (strncmp(line,"PHONE",5) == 0) {
|
| if (parse_phonetable(line, afflst)) {
|
| -#ifndef HUNSPELL_CHROME_CLIENT
|
| delete afflst;
|
| -#endif
|
| return 1;
|
| }
|
| }
|
| @@ -703,9 +613,7 @@
|
| /* parse in the checkcompoundpattern table */
|
| if (strncmp(line,"CHECKCOMPOUNDPATTERN",20) == 0) {
|
| if (parse_checkcpdtable(line, afflst)) {
|
| -#ifndef HUNSPELL_CHROME_CLIENT
|
| delete afflst;
|
| -#endif
|
| return 1;
|
| }
|
| }
|
| @@ -713,9 +621,7 @@
|
| /* parse in the defcompound table */
|
| if (strncmp(line,"COMPOUNDRULE",12) == 0) {
|
| if (parse_defcpdtable(line, afflst)) {
|
| -#ifndef HUNSPELL_CHROME_CLIENT
|
| delete afflst;
|
| -#endif
|
| return 1;
|
| }
|
| }
|
| @@ -723,9 +629,7 @@
|
| /* parse in the related character map table */
|
| if (strncmp(line,"MAP",3) == 0) {
|
| if (parse_maptable(line, afflst)) {
|
| -#ifndef HUNSPELL_CHROME_CLIENT
|
| delete afflst;
|
| -#endif
|
| return 1;
|
| }
|
| }
|
| @@ -733,21 +637,15 @@
|
| /* parse in the word breakpoints table */
|
| if (strncmp(line,"BREAK",5) == 0) {
|
| if (parse_breaktable(line, afflst)) {
|
| -#ifndef HUNSPELL_CHROME_CLIENT
|
| delete afflst;
|
| -#endif
|
| return 1;
|
| }
|
| }
|
|
|
| /* parse in the language for language specific codes */
|
| if (strncmp(line,"LANG",4) == 0) {
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| - if (parse_string(line, &lang, 0)) {
|
| -#else
|
| if (parse_string(line, &lang, afflst->getlinenum())) {
|
| delete afflst;
|
| -#endif
|
| return 1;
|
| }
|
| langnum = get_lang_num(lang);
|
| @@ -759,12 +657,8 @@
|
| }
|
|
|
| if (strncmp(line,"MAXNGRAMSUGS",12) == 0) {
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| - if (parse_num(line, &maxngramsugs)) {
|
| -#else
|
| if (parse_num(line, &maxngramsugs, afflst)) {
|
| delete afflst;
|
| -#endif
|
| return 1;
|
| }
|
| }
|
| @@ -783,24 +677,16 @@
|
|
|
| /* parse in the flag used by forbidden words */
|
| if (strncmp(line,"KEEPCASE",8) == 0) {
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| - if (parse_flag(line, &keepcase)) {
|
| -#else
|
| if (parse_flag(line, &keepcase, afflst)) {
|
| delete afflst;
|
| -#endif
|
| return 1;
|
| }
|
| }
|
|
|
| /* parse in the flag used by the affix generator */
|
| if (strncmp(line,"SUBSTANDARD",11) == 0) {
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| - if (parse_flag(line, &substandard)) {
|
| -#else
|
| if (parse_flag(line, &substandard, afflst)) {
|
| delete afflst;
|
| -#endif
|
| return 1;
|
| }
|
| }
|
| @@ -829,9 +715,7 @@
|
| #endif
|
| }
|
|
|
| -#ifndef HUNSPELL_CHROME_CLIENT
|
| delete afflst;
|
| -#endif
|
|
|
| // convert affix trees to sorted list
|
| process_pfx_tree_to_list();
|
| @@ -3461,11 +3345,7 @@
|
| }
|
|
|
| /* parse flag */
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| -int AffixMgr::parse_flag(char * line, unsigned short * out)
|
| -#else
|
| int AffixMgr::parse_flag(char * line, unsigned short * out, FileMgr * af)
|
| -#endif
|
| {
|
| char * s = NULL;
|
| if (*out != FLAG_NULL && !(*out >= DEFAULTFLAGS)) {
|
| @@ -3479,11 +3359,7 @@
|
| }
|
|
|
| /* parse num */
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| -int AffixMgr::parse_num(char * line, int * out)
|
| -#else
|
| int AffixMgr::parse_num(char * line, int * out, FileMgr * af)
|
| -#endif
|
| {
|
| char * s = NULL;
|
| if (*out != -1) {
|
| @@ -3497,11 +3373,7 @@
|
| }
|
|
|
| /* parse in the max syllablecount of compound words and */
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| -int AffixMgr::parse_cpdsyllable(char * line)
|
| -#else
|
| int AffixMgr::parse_cpdsyllable(char * line, FileMgr * af)
|
| -#endif
|
| {
|
| char * tp = line;
|
| char * piece;
|
| @@ -3623,11 +3495,7 @@
|
| #endif
|
|
|
| /* parse in the typical fault correcting table */
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| -int AffixMgr::parse_convtable(char * line, hunspell::LineIterator* iterator, RepList ** rl, const char * keyword)
|
| -#else
|
| int AffixMgr::parse_convtable(char * line, FileMgr * af, RepList ** rl, const char * keyword)
|
| -#endif
|
| {
|
| if (*rl) {
|
| HUNSPELL_WARNING(stderr, "error: multiple table definitions\n");
|
| @@ -3668,12 +3536,7 @@
|
| /* now parse the num lines to read in the remainder of the table */
|
| char * nl = line;
|
| for (int j=0; j < numrl; j++) {
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| - if (!iterator->AdvanceAndCopy(nl, MAXLNLEN))
|
| - return 1;
|
| -#else
|
| if (!(nl = af->getline())) return 1;
|
| -#endif
|
| mychomp(nl);
|
| tp = nl;
|
| i = 0;
|
| @@ -3714,11 +3577,7 @@
|
|
|
|
|
| /* parse in the typical fault correcting table */
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| -int AffixMgr::parse_phonetable(char * line, hunspell::LineIterator* iterator)
|
| -#else
|
| int AffixMgr::parse_phonetable(char * line, FileMgr * af)
|
| -#endif
|
| {
|
| if (phone) {
|
| HUNSPELL_WARNING(stderr, "error: multiple table definitions\n");
|
| @@ -3762,12 +3621,7 @@
|
| /* now parse the phone->num lines to read in the remainder of the table */
|
| char * nl = line;
|
| for (int j=0; j < phone->num; j++) {
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| - if (!iterator->AdvanceAndCopy(nl, MAXLNLEN))
|
| - return 1;
|
| -#else
|
| if (!(nl = af->getline())) return 1;
|
| -#endif
|
| mychomp(nl);
|
| tp = nl;
|
| i = 0;
|
| @@ -3806,11 +3660,7 @@
|
| }
|
|
|
| /* parse in the checkcompoundpattern table */
|
| -#if HUNSPELL_CHROME_CLIENT
|
| -int AffixMgr::parse_checkcpdtable(char * line, hunspell::LineIterator* iterator)
|
| -#else
|
| int AffixMgr::parse_checkcpdtable(char * line, FileMgr * af)
|
| -#endif
|
| {
|
| if (numcheckcpd != 0) {
|
| HUNSPELL_WARNING(stderr, "error: multiple table definitions\n");
|
| @@ -3850,12 +3700,7 @@
|
| /* now parse the numcheckcpd lines to read in the remainder of the table */
|
| char * nl = line;
|
| for (int j=0; j < numcheckcpd; j++) {
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| - if (!iterator->AdvanceAndCopy(nl, MAXLNLEN))
|
| - return 1;
|
| -#else
|
| if (!(nl = af->getline())) return 1;
|
| -#endif
|
| mychomp(nl);
|
| tp = nl;
|
| i = 0;
|
| @@ -3910,11 +3755,7 @@
|
| }
|
|
|
| /* parse in the compound rule table */
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| -int AffixMgr::parse_defcpdtable(char * line, hunspell::LineIterator* iterator)
|
| -#else
|
| int AffixMgr::parse_defcpdtable(char * line, FileMgr * af)
|
| -#endif
|
| {
|
| if (numdefcpd != 0) {
|
| HUNSPELL_WARNING(stderr, "error: multiple table definitions\n");
|
| @@ -3954,12 +3795,7 @@
|
| /* now parse the numdefcpd lines to read in the remainder of the table */
|
| char * nl = line;
|
| for (int j=0; j < numdefcpd; j++) {
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| - if (!iterator->AdvanceAndCopy(nl, MAXLNLEN))
|
| - return 1;
|
| -#else
|
| if (!(nl = af->getline())) return 1;
|
| -#endif
|
| mychomp(nl);
|
| tp = nl;
|
| i = 0;
|
| @@ -4018,11 +3854,7 @@
|
|
|
|
|
| /* parse in the character map table */
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| -int AffixMgr::parse_maptable(char * line, hunspell::LineIterator* iterator)
|
| -#else
|
| int AffixMgr::parse_maptable(char * line, FileMgr * af)
|
| -#endif
|
| {
|
| if (nummap != 0) {
|
| HUNSPELL_WARNING(stderr, "error: multiple table definitions\n");
|
| @@ -4062,12 +3894,7 @@
|
| /* now parse the nummap lines to read in the remainder of the table */
|
| char * nl = line;
|
| for (int j=0; j < nummap; j++) {
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| - if (!iterator->AdvanceAndCopy(nl, MAXLNLEN))
|
| - return 1;
|
| -#else
|
| if (!(nl = af->getline())) return 1;
|
| -#endif
|
| mychomp(nl);
|
| tp = nl;
|
| i = 0;
|
| @@ -4120,11 +3947,7 @@
|
| }
|
|
|
| /* parse in the word breakpoint table */
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| -int AffixMgr::parse_breaktable(char * line, hunspell::LineIterator* iterator)
|
| -#else
|
| int AffixMgr::parse_breaktable(char * line, FileMgr * af)
|
| -#endif
|
| {
|
| if (numbreak != 0) {
|
| HUNSPELL_WARNING(stderr, "error: multiple table definitions\n");
|
| @@ -4164,12 +3987,7 @@
|
| /* now parse the numbreak lines to read in the remainder of the table */
|
| char * nl = line;
|
| for (int j=0; j < numbreak; j++) {
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| - if (!iterator->AdvanceAndCopy(nl, MAXLNLEN))
|
| - return 1;
|
| -#else
|
| if (!(nl = af->getline())) return 1;
|
| -#endif
|
| mychomp(nl);
|
| tp = nl;
|
| i = 0;
|
| @@ -4228,11 +4046,7 @@
|
| }
|
| }
|
| }
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| -int AffixMgr::parse_affix(char * line, const char at, hunspell::LineIterator* iterator)
|
| -#else
|
| int AffixMgr::parse_affix(char * line, const char at, FileMgr * af, char * dupflags)
|
| -#endif
|
| {
|
| int numents = 0; // number of affentry structures to parse
|
|
|
| @@ -4324,12 +4138,7 @@
|
|
|
| // now parse numents affentries for this affix
|
| for (int j=0; j < numents; j++) {
|
| -#ifdef HUNSPELL_CHROME_CLIENT
|
| - if (!iterator->AdvanceAndCopy(nl, MAXLNLEN))
|
| - return 1;
|
| -#else
|
| if (!(nl = af->getline())) return 1;
|
| -#endif
|
| mychomp(nl);
|
| tp = nl;
|
| i = 0;
|
|
|