move workaround for old build system to other workarounds
[LibreOffice.git] / hunspell / hunspell-twoaffixcompound.patch
blob71881a25ac43bc1f41f269c318bf65fc6766ecbb
1 --- misc/hunspell-1.3.2/src/hunspell/affixmgr.cxx 2010-06-17 15:56:41.000000000 +0200
2 +++ misc/build/hunspell-1.3.2/src/hunspell/affixmgr.cxx 2011-02-10 20:47:22.000000000 +0100
3 @@ -48,6 +48,7 @@
4 compoundroot = FLAG_NULL; // compound word signing flag
5 compoundpermitflag = FLAG_NULL; // compound permitting flag for suffixed word
6 compoundforbidflag = FLAG_NULL; // compound fordidden flag for suffixed word
7 + compoundmoresuffixes = 0; // allow more suffixes within compound words
8 checkcompounddup = 0; // forbid double words in compounds
9 checkcompoundrep = 0; // forbid bad compounds (may be non compound word with a REP substitution)
10 checkcompoundcase = 0; // forbid upper and lowercase combinations at word bounds
11 @@ -404,6 +405,10 @@
15 + if (strncmp(line,"COMPOUNDMORESUFFIXES",20) == 0) {
16 + compoundmoresuffixes = 1;
17 + }
19 if (strncmp(line,"CHECKCOMPOUNDDUP",16) == 0) {
20 checkcompounddup = 1;
22 @@ -1626,8 +1631,9 @@
23 if (onlycpdrule) break;
24 if (compoundflag &&
25 !(rv = prefix_check(st, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN, compoundflag))) {
26 - if ((rv = suffix_check(st, i, 0, NULL, NULL, 0, NULL,
27 - FLAG_NULL, compoundflag, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) && !hu_mov_rule &&
28 + if (((rv = suffix_check(st, i, 0, NULL, NULL, 0, NULL,
29 + FLAG_NULL, compoundflag, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
30 + (compoundmoresuffixes && (rv = suffix_check_twosfx(st, i, 0, NULL, compoundflag)))) && !hu_mov_rule &&
31 sfx->getCont() &&
32 ((compoundforbidflag && TESTAFF(sfx->getCont(), compoundforbidflag,
33 sfx->getContLen())) || (compoundend &&
34 @@ -1640,9 +1646,11 @@
35 if (rv ||
36 (((wordnum == 0) && compoundbegin &&
37 ((rv = suffix_check(st, i, 0, NULL, NULL, 0, NULL, FLAG_NULL, compoundbegin, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
38 + (compoundmoresuffixes && (rv = suffix_check_twosfx(st, i, 0, NULL, compoundbegin))) || // twofold suffixes + compound
39 (rv = prefix_check(st, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN, compoundbegin)))) ||
40 ((wordnum > 0) && compoundmiddle &&
41 ((rv = suffix_check(st, i, 0, NULL, NULL, 0, NULL, FLAG_NULL, compoundmiddle, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
42 + (compoundmoresuffixes && (rv = suffix_check_twosfx(st, i, 0, NULL, compoundmiddle))) || // twofold suffixes + compound
43 (rv = prefix_check(st, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN, compoundmiddle)))))
44 ) checked_prefix = 1;
45 // else check forbiddenwords and needaffix
46 @@ -2118,8 +2126,9 @@
47 if (onlycpdrule) break;
48 if (compoundflag &&
49 !(rv = prefix_check(st, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN, compoundflag))) {
50 - if ((rv = suffix_check(st, i, 0, NULL, NULL, 0, NULL,
51 - FLAG_NULL, compoundflag, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) && !hu_mov_rule &&
52 + if (((rv = suffix_check(st, i, 0, NULL, NULL, 0, NULL,
53 + FLAG_NULL, compoundflag, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
54 + (compoundmoresuffixes && (rv = suffix_check_twosfx(st, i, 0, NULL, compoundflag)))) && !hu_mov_rule &&
55 sfx->getCont() &&
56 ((compoundforbidflag && TESTAFF(sfx->getCont(), compoundforbidflag,
57 sfx->getContLen())) || (compoundend &&
58 @@ -2132,9 +2141,11 @@
59 if (rv ||
60 (((wordnum == 0) && compoundbegin &&
61 ((rv = suffix_check(st, i, 0, NULL, NULL, 0, NULL, FLAG_NULL, compoundbegin, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
62 + (compoundmoresuffixes && (rv = suffix_check_twosfx(st, i, 0, NULL, compoundbegin))) || // twofold suffix+compound
63 (rv = prefix_check(st, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN, compoundbegin)))) ||
64 ((wordnum > 0) && compoundmiddle &&
65 ((rv = suffix_check(st, i, 0, NULL, NULL, 0, NULL, FLAG_NULL, compoundmiddle, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
66 + (compoundmoresuffixes && (rv = suffix_check_twosfx(st, i, 0, NULL, compoundmiddle))) || // twofold suffix+compound
67 (rv = prefix_check(st, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN, compoundmiddle)))))
68 ) {
69 // char * p = prefix_check_morph(st, i, 0, compound);
70 --- misc/hunspell-1.3.2/src/hunspell/affixmgr.hxx 2010-06-17 15:56:41.000000000 +0200
71 +++ misc/build/hunspell-1.3.2/src/hunspell/affixmgr.hxx 2011-02-10 20:47:22.000000000 +0100
72 @@ -41,6 +41,7 @@
73 FLAG compoundroot;
74 FLAG compoundforbidflag;
75 FLAG compoundpermitflag;
76 + int compoundmoresuffixes;
77 int checkcompounddup;
78 int checkcompoundrep;
79 int checkcompoundcase;