mirror of https://github.com/apache/lucene.git
LUCENE-4279: regenerate snowball stemmers so they aren't so heavy
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1368188 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b26dd733f7
commit
f1ae7dad35
|
@ -99,6 +99,10 @@ Optimizations
|
|||
* LUCENE-4235: Remove enforcing of Filter rewrite for NRQ queries.
|
||||
(Uwe Schindler)
|
||||
|
||||
* LUCENE-4279: Regenerated snowball Stemmers from snowball r554,
|
||||
making them substantially more lightweight. Behavior is unchanged.
|
||||
(Robert Muir)
|
||||
|
||||
Bug Fixes
|
||||
|
||||
* LUCENE-4109: BooleanQueries are not parsed correctly with the
|
||||
|
|
|
@ -1,423 +1,439 @@
|
|||
// This file was generated automatically by the Snowball to Java compiler
|
||||
|
||||
package org.tartarus.snowball.ext;
|
||||
import org.tartarus.snowball.SnowballProgram;
|
||||
import org.tartarus.snowball.Among;
|
||||
|
||||
/**
|
||||
* Generated class implementing code defined by a snowball script.
|
||||
*/
|
||||
import org.tartarus.snowball.Among;
|
||||
import org.tartarus.snowball.SnowballProgram;
|
||||
|
||||
/**
|
||||
* This class was automatically generated by a Snowball to Java compiler
|
||||
* It implements the stemming algorithm defined by a snowball script.
|
||||
*/
|
||||
|
||||
public class DanishStemmer extends SnowballProgram {
|
||||
|
||||
private Among a_0[] = {
|
||||
new Among ( "hed", -1, 1, "", this),
|
||||
new Among ( "ethed", 0, 1, "", this),
|
||||
new Among ( "ered", -1, 1, "", this),
|
||||
new Among ( "e", -1, 1, "", this),
|
||||
new Among ( "erede", 3, 1, "", this),
|
||||
new Among ( "ende", 3, 1, "", this),
|
||||
new Among ( "erende", 5, 1, "", this),
|
||||
new Among ( "ene", 3, 1, "", this),
|
||||
new Among ( "erne", 3, 1, "", this),
|
||||
new Among ( "ere", 3, 1, "", this),
|
||||
new Among ( "en", -1, 1, "", this),
|
||||
new Among ( "heden", 10, 1, "", this),
|
||||
new Among ( "eren", 10, 1, "", this),
|
||||
new Among ( "er", -1, 1, "", this),
|
||||
new Among ( "heder", 13, 1, "", this),
|
||||
new Among ( "erer", 13, 1, "", this),
|
||||
new Among ( "s", -1, 2, "", this),
|
||||
new Among ( "heds", 16, 1, "", this),
|
||||
new Among ( "es", 16, 1, "", this),
|
||||
new Among ( "endes", 18, 1, "", this),
|
||||
new Among ( "erendes", 19, 1, "", this),
|
||||
new Among ( "enes", 18, 1, "", this),
|
||||
new Among ( "ernes", 18, 1, "", this),
|
||||
new Among ( "eres", 18, 1, "", this),
|
||||
new Among ( "ens", 16, 1, "", this),
|
||||
new Among ( "hedens", 24, 1, "", this),
|
||||
new Among ( "erens", 24, 1, "", this),
|
||||
new Among ( "ers", 16, 1, "", this),
|
||||
new Among ( "ets", 16, 1, "", this),
|
||||
new Among ( "erets", 28, 1, "", this),
|
||||
new Among ( "et", -1, 1, "", this),
|
||||
new Among ( "eret", 30, 1, "", this)
|
||||
};
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Among a_1[] = {
|
||||
new Among ( "gd", -1, -1, "", this),
|
||||
new Among ( "dt", -1, -1, "", this),
|
||||
new Among ( "gt", -1, -1, "", this),
|
||||
new Among ( "kt", -1, -1, "", this)
|
||||
};
|
||||
private final static DanishStemmer methodObject = new DanishStemmer ();
|
||||
|
||||
private Among a_2[] = {
|
||||
new Among ( "ig", -1, 1, "", this),
|
||||
new Among ( "lig", 0, 1, "", this),
|
||||
new Among ( "elig", 1, 1, "", this),
|
||||
new Among ( "els", -1, 1, "", this),
|
||||
new Among ( "l\u00F8st", -1, 2, "", this)
|
||||
};
|
||||
private final static Among a_0[] = {
|
||||
new Among ( "hed", -1, 1, "", methodObject ),
|
||||
new Among ( "ethed", 0, 1, "", methodObject ),
|
||||
new Among ( "ered", -1, 1, "", methodObject ),
|
||||
new Among ( "e", -1, 1, "", methodObject ),
|
||||
new Among ( "erede", 3, 1, "", methodObject ),
|
||||
new Among ( "ende", 3, 1, "", methodObject ),
|
||||
new Among ( "erende", 5, 1, "", methodObject ),
|
||||
new Among ( "ene", 3, 1, "", methodObject ),
|
||||
new Among ( "erne", 3, 1, "", methodObject ),
|
||||
new Among ( "ere", 3, 1, "", methodObject ),
|
||||
new Among ( "en", -1, 1, "", methodObject ),
|
||||
new Among ( "heden", 10, 1, "", methodObject ),
|
||||
new Among ( "eren", 10, 1, "", methodObject ),
|
||||
new Among ( "er", -1, 1, "", methodObject ),
|
||||
new Among ( "heder", 13, 1, "", methodObject ),
|
||||
new Among ( "erer", 13, 1, "", methodObject ),
|
||||
new Among ( "s", -1, 2, "", methodObject ),
|
||||
new Among ( "heds", 16, 1, "", methodObject ),
|
||||
new Among ( "es", 16, 1, "", methodObject ),
|
||||
new Among ( "endes", 18, 1, "", methodObject ),
|
||||
new Among ( "erendes", 19, 1, "", methodObject ),
|
||||
new Among ( "enes", 18, 1, "", methodObject ),
|
||||
new Among ( "ernes", 18, 1, "", methodObject ),
|
||||
new Among ( "eres", 18, 1, "", methodObject ),
|
||||
new Among ( "ens", 16, 1, "", methodObject ),
|
||||
new Among ( "hedens", 24, 1, "", methodObject ),
|
||||
new Among ( "erens", 24, 1, "", methodObject ),
|
||||
new Among ( "ers", 16, 1, "", methodObject ),
|
||||
new Among ( "ets", 16, 1, "", methodObject ),
|
||||
new Among ( "erets", 28, 1, "", methodObject ),
|
||||
new Among ( "et", -1, 1, "", methodObject ),
|
||||
new Among ( "eret", 30, 1, "", methodObject )
|
||||
};
|
||||
|
||||
private static final char g_v[] = {17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 128 };
|
||||
private final static Among a_1[] = {
|
||||
new Among ( "gd", -1, -1, "", methodObject ),
|
||||
new Among ( "dt", -1, -1, "", methodObject ),
|
||||
new Among ( "gt", -1, -1, "", methodObject ),
|
||||
new Among ( "kt", -1, -1, "", methodObject )
|
||||
};
|
||||
|
||||
private static final char g_s_ending[] = {239, 254, 42, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16 };
|
||||
private final static Among a_2[] = {
|
||||
new Among ( "ig", -1, 1, "", methodObject ),
|
||||
new Among ( "lig", 0, 1, "", methodObject ),
|
||||
new Among ( "elig", 1, 1, "", methodObject ),
|
||||
new Among ( "els", -1, 1, "", methodObject ),
|
||||
new Among ( "l\u00F8st", -1, 2, "", methodObject )
|
||||
};
|
||||
|
||||
private static final char g_v[] = {17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 128 };
|
||||
|
||||
private static final char g_s_ending[] = {239, 254, 42, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16 };
|
||||
|
||||
private int I_x;
|
||||
private int I_p1;
|
||||
private StringBuilder S_ch = new StringBuilder();
|
||||
private java.lang.StringBuilder S_ch = new java.lang.StringBuilder();
|
||||
|
||||
private void copy_from(DanishStemmer other) {
|
||||
I_x = other.I_x;
|
||||
I_p1 = other.I_p1;
|
||||
S_ch = other.S_ch;
|
||||
super.copy_from(other);
|
||||
}
|
||||
private void copy_from(DanishStemmer other) {
|
||||
I_x = other.I_x;
|
||||
I_p1 = other.I_p1;
|
||||
S_ch = other.S_ch;
|
||||
super.copy_from(other);
|
||||
}
|
||||
|
||||
private boolean r_mark_regions() {
|
||||
private boolean r_mark_regions() {
|
||||
int v_1;
|
||||
int v_2;
|
||||
// (, line 29
|
||||
I_p1 = limit;
|
||||
// test, line 33
|
||||
v_1 = cursor;
|
||||
// (, line 33
|
||||
// hop, line 33
|
||||
{
|
||||
int c = cursor + 3;
|
||||
if (0 > c || c > limit)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cursor = c;
|
||||
}
|
||||
// setmark x, line 33
|
||||
I_x = cursor;
|
||||
cursor = v_1;
|
||||
// goto, line 34
|
||||
golab0: while(true)
|
||||
{
|
||||
v_2 = cursor;
|
||||
lab1: do {
|
||||
if (!(in_grouping(g_v, 97, 248)))
|
||||
// (, line 29
|
||||
I_p1 = limit;
|
||||
// test, line 33
|
||||
v_1 = cursor;
|
||||
// (, line 33
|
||||
// hop, line 33
|
||||
{
|
||||
break lab1;
|
||||
int c = cursor + 3;
|
||||
if (0 > c || c > limit)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cursor = c;
|
||||
}
|
||||
cursor = v_2;
|
||||
break golab0;
|
||||
} while (false);
|
||||
cursor = v_2;
|
||||
if (cursor >= limit)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cursor++;
|
||||
}
|
||||
// gopast, line 34
|
||||
golab2: while(true)
|
||||
{
|
||||
lab3: do {
|
||||
if (!(out_grouping(g_v, 97, 248)))
|
||||
// setmark x, line 33
|
||||
I_x = cursor;
|
||||
cursor = v_1;
|
||||
// goto, line 34
|
||||
golab0: while(true)
|
||||
{
|
||||
break lab3;
|
||||
v_2 = cursor;
|
||||
lab1: do {
|
||||
if (!(in_grouping(g_v, 97, 248)))
|
||||
{
|
||||
break lab1;
|
||||
}
|
||||
cursor = v_2;
|
||||
break golab0;
|
||||
} while (false);
|
||||
cursor = v_2;
|
||||
if (cursor >= limit)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cursor++;
|
||||
}
|
||||
break golab2;
|
||||
} while (false);
|
||||
if (cursor >= limit)
|
||||
{
|
||||
return false;
|
||||
// gopast, line 34
|
||||
golab2: while(true)
|
||||
{
|
||||
lab3: do {
|
||||
if (!(out_grouping(g_v, 97, 248)))
|
||||
{
|
||||
break lab3;
|
||||
}
|
||||
break golab2;
|
||||
} while (false);
|
||||
if (cursor >= limit)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cursor++;
|
||||
}
|
||||
// setmark p1, line 34
|
||||
I_p1 = cursor;
|
||||
// try, line 35
|
||||
lab4: do {
|
||||
// (, line 35
|
||||
if (!(I_p1 < I_x))
|
||||
{
|
||||
break lab4;
|
||||
}
|
||||
I_p1 = I_x;
|
||||
} while (false);
|
||||
return true;
|
||||
}
|
||||
cursor++;
|
||||
}
|
||||
// setmark p1, line 34
|
||||
I_p1 = cursor;
|
||||
// try, line 35
|
||||
lab4: do {
|
||||
// (, line 35
|
||||
if (!(I_p1 < I_x))
|
||||
{
|
||||
break lab4;
|
||||
}
|
||||
I_p1 = I_x;
|
||||
} while (false);
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean r_main_suffix() {
|
||||
private boolean r_main_suffix() {
|
||||
int among_var;
|
||||
int v_1;
|
||||
int v_2;
|
||||
// (, line 40
|
||||
// setlimit, line 41
|
||||
v_1 = limit - cursor;
|
||||
// tomark, line 41
|
||||
if (cursor < I_p1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cursor = I_p1;
|
||||
v_2 = limit_backward;
|
||||
limit_backward = cursor;
|
||||
cursor = limit - v_1;
|
||||
// (, line 41
|
||||
// [, line 41
|
||||
ket = cursor;
|
||||
// substring, line 41
|
||||
among_var = find_among_b(a_0, 32);
|
||||
if (among_var == 0)
|
||||
{
|
||||
limit_backward = v_2;
|
||||
return false;
|
||||
}
|
||||
// ], line 41
|
||||
bra = cursor;
|
||||
limit_backward = v_2;
|
||||
switch(among_var) {
|
||||
case 0:
|
||||
return false;
|
||||
case 1:
|
||||
// (, line 48
|
||||
// delete, line 48
|
||||
slice_del();
|
||||
break;
|
||||
case 2:
|
||||
// (, line 50
|
||||
if (!(in_grouping_b(g_s_ending, 97, 229)))
|
||||
// (, line 40
|
||||
// setlimit, line 41
|
||||
v_1 = limit - cursor;
|
||||
// tomark, line 41
|
||||
if (cursor < I_p1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// delete, line 50
|
||||
slice_del();
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
cursor = I_p1;
|
||||
v_2 = limit_backward;
|
||||
limit_backward = cursor;
|
||||
cursor = limit - v_1;
|
||||
// (, line 41
|
||||
// [, line 41
|
||||
ket = cursor;
|
||||
// substring, line 41
|
||||
among_var = find_among_b(a_0, 32);
|
||||
if (among_var == 0)
|
||||
{
|
||||
limit_backward = v_2;
|
||||
return false;
|
||||
}
|
||||
// ], line 41
|
||||
bra = cursor;
|
||||
limit_backward = v_2;
|
||||
switch(among_var) {
|
||||
case 0:
|
||||
return false;
|
||||
case 1:
|
||||
// (, line 48
|
||||
// delete, line 48
|
||||
slice_del();
|
||||
break;
|
||||
case 2:
|
||||
// (, line 50
|
||||
if (!(in_grouping_b(g_s_ending, 97, 229)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// delete, line 50
|
||||
slice_del();
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean r_consonant_pair() {
|
||||
private boolean r_consonant_pair() {
|
||||
int v_1;
|
||||
int v_2;
|
||||
int v_3;
|
||||
// (, line 54
|
||||
// test, line 55
|
||||
v_1 = limit - cursor;
|
||||
// (, line 55
|
||||
// setlimit, line 56
|
||||
v_2 = limit - cursor;
|
||||
// tomark, line 56
|
||||
if (cursor < I_p1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cursor = I_p1;
|
||||
v_3 = limit_backward;
|
||||
limit_backward = cursor;
|
||||
cursor = limit - v_2;
|
||||
// (, line 56
|
||||
// [, line 56
|
||||
ket = cursor;
|
||||
// substring, line 56
|
||||
if (find_among_b(a_1, 4) == 0)
|
||||
{
|
||||
limit_backward = v_3;
|
||||
return false;
|
||||
}
|
||||
// ], line 56
|
||||
bra = cursor;
|
||||
limit_backward = v_3;
|
||||
cursor = limit - v_1;
|
||||
// next, line 62
|
||||
if (cursor <= limit_backward)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cursor--;
|
||||
// ], line 62
|
||||
bra = cursor;
|
||||
// delete, line 62
|
||||
slice_del();
|
||||
return true;
|
||||
}
|
||||
// (, line 54
|
||||
// test, line 55
|
||||
v_1 = limit - cursor;
|
||||
// (, line 55
|
||||
// setlimit, line 56
|
||||
v_2 = limit - cursor;
|
||||
// tomark, line 56
|
||||
if (cursor < I_p1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cursor = I_p1;
|
||||
v_3 = limit_backward;
|
||||
limit_backward = cursor;
|
||||
cursor = limit - v_2;
|
||||
// (, line 56
|
||||
// [, line 56
|
||||
ket = cursor;
|
||||
// substring, line 56
|
||||
if (find_among_b(a_1, 4) == 0)
|
||||
{
|
||||
limit_backward = v_3;
|
||||
return false;
|
||||
}
|
||||
// ], line 56
|
||||
bra = cursor;
|
||||
limit_backward = v_3;
|
||||
cursor = limit - v_1;
|
||||
// next, line 62
|
||||
if (cursor <= limit_backward)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cursor--;
|
||||
// ], line 62
|
||||
bra = cursor;
|
||||
// delete, line 62
|
||||
slice_del();
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean r_other_suffix() {
|
||||
private boolean r_other_suffix() {
|
||||
int among_var;
|
||||
int v_1;
|
||||
int v_2;
|
||||
int v_3;
|
||||
int v_4;
|
||||
// (, line 65
|
||||
// do, line 66
|
||||
v_1 = limit - cursor;
|
||||
lab0: do {
|
||||
// (, line 66
|
||||
// [, line 66
|
||||
ket = cursor;
|
||||
// literal, line 66
|
||||
if (!(eq_s_b(2, "st")))
|
||||
{
|
||||
break lab0;
|
||||
}
|
||||
// ], line 66
|
||||
bra = cursor;
|
||||
// literal, line 66
|
||||
if (!(eq_s_b(2, "ig")))
|
||||
{
|
||||
break lab0;
|
||||
}
|
||||
// delete, line 66
|
||||
slice_del();
|
||||
} while (false);
|
||||
cursor = limit - v_1;
|
||||
// setlimit, line 67
|
||||
v_2 = limit - cursor;
|
||||
// tomark, line 67
|
||||
if (cursor < I_p1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cursor = I_p1;
|
||||
v_3 = limit_backward;
|
||||
limit_backward = cursor;
|
||||
cursor = limit - v_2;
|
||||
// (, line 67
|
||||
// [, line 67
|
||||
ket = cursor;
|
||||
// substring, line 67
|
||||
among_var = find_among_b(a_2, 5);
|
||||
if (among_var == 0)
|
||||
{
|
||||
limit_backward = v_3;
|
||||
return false;
|
||||
}
|
||||
// ], line 67
|
||||
bra = cursor;
|
||||
limit_backward = v_3;
|
||||
switch(among_var) {
|
||||
case 0:
|
||||
return false;
|
||||
case 1:
|
||||
// (, line 70
|
||||
// delete, line 70
|
||||
slice_del();
|
||||
// do, line 70
|
||||
v_4 = limit - cursor;
|
||||
lab1: do {
|
||||
// call consonant_pair, line 70
|
||||
if (!r_consonant_pair())
|
||||
// (, line 65
|
||||
// do, line 66
|
||||
v_1 = limit - cursor;
|
||||
lab0: do {
|
||||
// (, line 66
|
||||
// [, line 66
|
||||
ket = cursor;
|
||||
// literal, line 66
|
||||
if (!(eq_s_b(2, "st")))
|
||||
{
|
||||
break lab1;
|
||||
break lab0;
|
||||
}
|
||||
// ], line 66
|
||||
bra = cursor;
|
||||
// literal, line 66
|
||||
if (!(eq_s_b(2, "ig")))
|
||||
{
|
||||
break lab0;
|
||||
}
|
||||
// delete, line 66
|
||||
slice_del();
|
||||
} while (false);
|
||||
cursor = limit - v_4;
|
||||
break;
|
||||
case 2:
|
||||
// (, line 72
|
||||
// <-, line 72
|
||||
slice_from("l\u00F8s");
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
cursor = limit - v_1;
|
||||
// setlimit, line 67
|
||||
v_2 = limit - cursor;
|
||||
// tomark, line 67
|
||||
if (cursor < I_p1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cursor = I_p1;
|
||||
v_3 = limit_backward;
|
||||
limit_backward = cursor;
|
||||
cursor = limit - v_2;
|
||||
// (, line 67
|
||||
// [, line 67
|
||||
ket = cursor;
|
||||
// substring, line 67
|
||||
among_var = find_among_b(a_2, 5);
|
||||
if (among_var == 0)
|
||||
{
|
||||
limit_backward = v_3;
|
||||
return false;
|
||||
}
|
||||
// ], line 67
|
||||
bra = cursor;
|
||||
limit_backward = v_3;
|
||||
switch(among_var) {
|
||||
case 0:
|
||||
return false;
|
||||
case 1:
|
||||
// (, line 70
|
||||
// delete, line 70
|
||||
slice_del();
|
||||
// do, line 70
|
||||
v_4 = limit - cursor;
|
||||
lab1: do {
|
||||
// call consonant_pair, line 70
|
||||
if (!r_consonant_pair())
|
||||
{
|
||||
break lab1;
|
||||
}
|
||||
} while (false);
|
||||
cursor = limit - v_4;
|
||||
break;
|
||||
case 2:
|
||||
// (, line 72
|
||||
// <-, line 72
|
||||
slice_from("l\u00F8s");
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean r_undouble() {
|
||||
private boolean r_undouble() {
|
||||
int v_1;
|
||||
int v_2;
|
||||
// (, line 75
|
||||
// setlimit, line 76
|
||||
v_1 = limit - cursor;
|
||||
// tomark, line 76
|
||||
if (cursor < I_p1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cursor = I_p1;
|
||||
v_2 = limit_backward;
|
||||
limit_backward = cursor;
|
||||
cursor = limit - v_1;
|
||||
// (, line 76
|
||||
// [, line 76
|
||||
ket = cursor;
|
||||
if (!(out_grouping_b(g_v, 97, 248)))
|
||||
{
|
||||
limit_backward = v_2;
|
||||
return false;
|
||||
}
|
||||
// ], line 76
|
||||
bra = cursor;
|
||||
// -> ch, line 76
|
||||
S_ch = slice_to(S_ch);
|
||||
limit_backward = v_2;
|
||||
// name ch, line 77
|
||||
if (!(eq_v_b(S_ch)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// delete, line 78
|
||||
slice_del();
|
||||
return true;
|
||||
}
|
||||
// (, line 75
|
||||
// setlimit, line 76
|
||||
v_1 = limit - cursor;
|
||||
// tomark, line 76
|
||||
if (cursor < I_p1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cursor = I_p1;
|
||||
v_2 = limit_backward;
|
||||
limit_backward = cursor;
|
||||
cursor = limit - v_1;
|
||||
// (, line 76
|
||||
// [, line 76
|
||||
ket = cursor;
|
||||
if (!(out_grouping_b(g_v, 97, 248)))
|
||||
{
|
||||
limit_backward = v_2;
|
||||
return false;
|
||||
}
|
||||
// ], line 76
|
||||
bra = cursor;
|
||||
// -> ch, line 76
|
||||
S_ch = slice_to(S_ch);
|
||||
limit_backward = v_2;
|
||||
// name ch, line 77
|
||||
if (!(eq_v_b(S_ch)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// delete, line 78
|
||||
slice_del();
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean stem() {
|
||||
public boolean stem() {
|
||||
int v_1;
|
||||
int v_2;
|
||||
int v_3;
|
||||
int v_4;
|
||||
int v_5;
|
||||
// (, line 82
|
||||
// do, line 84
|
||||
v_1 = cursor;
|
||||
lab0: do {
|
||||
// call mark_regions, line 84
|
||||
if (!r_mark_regions())
|
||||
{
|
||||
break lab0;
|
||||
// (, line 82
|
||||
// do, line 84
|
||||
v_1 = cursor;
|
||||
lab0: do {
|
||||
// call mark_regions, line 84
|
||||
if (!r_mark_regions())
|
||||
{
|
||||
break lab0;
|
||||
}
|
||||
} while (false);
|
||||
cursor = v_1;
|
||||
// backwards, line 85
|
||||
limit_backward = cursor; cursor = limit;
|
||||
// (, line 85
|
||||
// do, line 86
|
||||
v_2 = limit - cursor;
|
||||
lab1: do {
|
||||
// call main_suffix, line 86
|
||||
if (!r_main_suffix())
|
||||
{
|
||||
break lab1;
|
||||
}
|
||||
} while (false);
|
||||
cursor = limit - v_2;
|
||||
// do, line 87
|
||||
v_3 = limit - cursor;
|
||||
lab2: do {
|
||||
// call consonant_pair, line 87
|
||||
if (!r_consonant_pair())
|
||||
{
|
||||
break lab2;
|
||||
}
|
||||
} while (false);
|
||||
cursor = limit - v_3;
|
||||
// do, line 88
|
||||
v_4 = limit - cursor;
|
||||
lab3: do {
|
||||
// call other_suffix, line 88
|
||||
if (!r_other_suffix())
|
||||
{
|
||||
break lab3;
|
||||
}
|
||||
} while (false);
|
||||
cursor = limit - v_4;
|
||||
// do, line 89
|
||||
v_5 = limit - cursor;
|
||||
lab4: do {
|
||||
// call undouble, line 89
|
||||
if (!r_undouble())
|
||||
{
|
||||
break lab4;
|
||||
}
|
||||
} while (false);
|
||||
cursor = limit - v_5;
|
||||
cursor = limit_backward; return true;
|
||||
}
|
||||
} while (false);
|
||||
cursor = v_1;
|
||||
// backwards, line 85
|
||||
limit_backward = cursor; cursor = limit;
|
||||
// (, line 85
|
||||
// do, line 86
|
||||
v_2 = limit - cursor;
|
||||
lab1: do {
|
||||
// call main_suffix, line 86
|
||||
if (!r_main_suffix())
|
||||
{
|
||||
break lab1;
|
||||
}
|
||||
} while (false);
|
||||
cursor = limit - v_2;
|
||||
// do, line 87
|
||||
v_3 = limit - cursor;
|
||||
lab2: do {
|
||||
// call consonant_pair, line 87
|
||||
if (!r_consonant_pair())
|
||||
{
|
||||
break lab2;
|
||||
}
|
||||
} while (false);
|
||||
cursor = limit - v_3;
|
||||
// do, line 88
|
||||
v_4 = limit - cursor;
|
||||
lab3: do {
|
||||
// call other_suffix, line 88
|
||||
if (!r_other_suffix())
|
||||
{
|
||||
break lab3;
|
||||
}
|
||||
} while (false);
|
||||
cursor = limit - v_4;
|
||||
// do, line 89
|
||||
v_5 = limit - cursor;
|
||||
lab4: do {
|
||||
// call undouble, line 89
|
||||
if (!r_undouble())
|
||||
{
|
||||
break lab4;
|
||||
}
|
||||
} while (false);
|
||||
cursor = limit - v_5;
|
||||
cursor = limit_backward; return true;
|
||||
|
||||
public boolean equals( Object o ) {
|
||||
return o instanceof DanishStemmer;
|
||||
}
|
||||
|
||||
}
|
||||
public int hashCode() {
|
||||
return DanishStemmer.class.getName().hashCode();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,358 +1,375 @@
|
|||
// This file was generated automatically by the Snowball to Java compiler
|
||||
|
||||
package org.tartarus.snowball.ext;
|
||||
import org.tartarus.snowball.SnowballProgram;
|
||||
import org.tartarus.snowball.Among;
|
||||
|
||||
/**
|
||||
* Generated class implementing code defined by a snowball script.
|
||||
*/
|
||||
import org.tartarus.snowball.Among;
|
||||
import org.tartarus.snowball.SnowballProgram;
|
||||
|
||||
/**
|
||||
* This class was automatically generated by a Snowball to Java compiler
|
||||
* It implements the stemming algorithm defined by a snowball script.
|
||||
*/
|
||||
|
||||
public class NorwegianStemmer extends SnowballProgram {
|
||||
|
||||
private Among a_0[] = {
|
||||
new Among ( "a", -1, 1, "", this),
|
||||
new Among ( "e", -1, 1, "", this),
|
||||
new Among ( "ede", 1, 1, "", this),
|
||||
new Among ( "ande", 1, 1, "", this),
|
||||
new Among ( "ende", 1, 1, "", this),
|
||||
new Among ( "ane", 1, 1, "", this),
|
||||
new Among ( "ene", 1, 1, "", this),
|
||||
new Among ( "hetene", 6, 1, "", this),
|
||||
new Among ( "erte", 1, 3, "", this),
|
||||
new Among ( "en", -1, 1, "", this),
|
||||
new Among ( "heten", 9, 1, "", this),
|
||||
new Among ( "ar", -1, 1, "", this),
|
||||
new Among ( "er", -1, 1, "", this),
|
||||
new Among ( "heter", 12, 1, "", this),
|
||||
new Among ( "s", -1, 2, "", this),
|
||||
new Among ( "as", 14, 1, "", this),
|
||||
new Among ( "es", 14, 1, "", this),
|
||||
new Among ( "edes", 16, 1, "", this),
|
||||
new Among ( "endes", 16, 1, "", this),
|
||||
new Among ( "enes", 16, 1, "", this),
|
||||
new Among ( "hetenes", 19, 1, "", this),
|
||||
new Among ( "ens", 14, 1, "", this),
|
||||
new Among ( "hetens", 21, 1, "", this),
|
||||
new Among ( "ers", 14, 1, "", this),
|
||||
new Among ( "ets", 14, 1, "", this),
|
||||
new Among ( "et", -1, 1, "", this),
|
||||
new Among ( "het", 25, 1, "", this),
|
||||
new Among ( "ert", -1, 3, "", this),
|
||||
new Among ( "ast", -1, 1, "", this)
|
||||
};
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Among a_1[] = {
|
||||
new Among ( "dt", -1, -1, "", this),
|
||||
new Among ( "vt", -1, -1, "", this)
|
||||
};
|
||||
private final static NorwegianStemmer methodObject = new NorwegianStemmer ();
|
||||
|
||||
private Among a_2[] = {
|
||||
new Among ( "leg", -1, 1, "", this),
|
||||
new Among ( "eleg", 0, 1, "", this),
|
||||
new Among ( "ig", -1, 1, "", this),
|
||||
new Among ( "eig", 2, 1, "", this),
|
||||
new Among ( "lig", 2, 1, "", this),
|
||||
new Among ( "elig", 4, 1, "", this),
|
||||
new Among ( "els", -1, 1, "", this),
|
||||
new Among ( "lov", -1, 1, "", this),
|
||||
new Among ( "elov", 7, 1, "", this),
|
||||
new Among ( "slov", 7, 1, "", this),
|
||||
new Among ( "hetslov", 9, 1, "", this)
|
||||
};
|
||||
private final static Among a_0[] = {
|
||||
new Among ( "a", -1, 1, "", methodObject ),
|
||||
new Among ( "e", -1, 1, "", methodObject ),
|
||||
new Among ( "ede", 1, 1, "", methodObject ),
|
||||
new Among ( "ande", 1, 1, "", methodObject ),
|
||||
new Among ( "ende", 1, 1, "", methodObject ),
|
||||
new Among ( "ane", 1, 1, "", methodObject ),
|
||||
new Among ( "ene", 1, 1, "", methodObject ),
|
||||
new Among ( "hetene", 6, 1, "", methodObject ),
|
||||
new Among ( "erte", 1, 3, "", methodObject ),
|
||||
new Among ( "en", -1, 1, "", methodObject ),
|
||||
new Among ( "heten", 9, 1, "", methodObject ),
|
||||
new Among ( "ar", -1, 1, "", methodObject ),
|
||||
new Among ( "er", -1, 1, "", methodObject ),
|
||||
new Among ( "heter", 12, 1, "", methodObject ),
|
||||
new Among ( "s", -1, 2, "", methodObject ),
|
||||
new Among ( "as", 14, 1, "", methodObject ),
|
||||
new Among ( "es", 14, 1, "", methodObject ),
|
||||
new Among ( "edes", 16, 1, "", methodObject ),
|
||||
new Among ( "endes", 16, 1, "", methodObject ),
|
||||
new Among ( "enes", 16, 1, "", methodObject ),
|
||||
new Among ( "hetenes", 19, 1, "", methodObject ),
|
||||
new Among ( "ens", 14, 1, "", methodObject ),
|
||||
new Among ( "hetens", 21, 1, "", methodObject ),
|
||||
new Among ( "ers", 14, 1, "", methodObject ),
|
||||
new Among ( "ets", 14, 1, "", methodObject ),
|
||||
new Among ( "et", -1, 1, "", methodObject ),
|
||||
new Among ( "het", 25, 1, "", methodObject ),
|
||||
new Among ( "ert", -1, 3, "", methodObject ),
|
||||
new Among ( "ast", -1, 1, "", methodObject )
|
||||
};
|
||||
|
||||
private static final char g_v[] = {17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 128 };
|
||||
private final static Among a_1[] = {
|
||||
new Among ( "dt", -1, -1, "", methodObject ),
|
||||
new Among ( "vt", -1, -1, "", methodObject )
|
||||
};
|
||||
|
||||
private static final char g_s_ending[] = {119, 125, 149, 1 };
|
||||
private final static Among a_2[] = {
|
||||
new Among ( "leg", -1, 1, "", methodObject ),
|
||||
new Among ( "eleg", 0, 1, "", methodObject ),
|
||||
new Among ( "ig", -1, 1, "", methodObject ),
|
||||
new Among ( "eig", 2, 1, "", methodObject ),
|
||||
new Among ( "lig", 2, 1, "", methodObject ),
|
||||
new Among ( "elig", 4, 1, "", methodObject ),
|
||||
new Among ( "els", -1, 1, "", methodObject ),
|
||||
new Among ( "lov", -1, 1, "", methodObject ),
|
||||
new Among ( "elov", 7, 1, "", methodObject ),
|
||||
new Among ( "slov", 7, 1, "", methodObject ),
|
||||
new Among ( "hetslov", 9, 1, "", methodObject )
|
||||
};
|
||||
|
||||
private static final char g_v[] = {17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 128 };
|
||||
|
||||
private static final char g_s_ending[] = {119, 125, 149, 1 };
|
||||
|
||||
private int I_x;
|
||||
private int I_p1;
|
||||
|
||||
private void copy_from(NorwegianStemmer other) {
|
||||
I_x = other.I_x;
|
||||
I_p1 = other.I_p1;
|
||||
super.copy_from(other);
|
||||
}
|
||||
private void copy_from(NorwegianStemmer other) {
|
||||
I_x = other.I_x;
|
||||
I_p1 = other.I_p1;
|
||||
super.copy_from(other);
|
||||
}
|
||||
|
||||
private boolean r_mark_regions() {
|
||||
private boolean r_mark_regions() {
|
||||
int v_1;
|
||||
int v_2;
|
||||
// (, line 26
|
||||
I_p1 = limit;
|
||||
// test, line 30
|
||||
v_1 = cursor;
|
||||
// (, line 30
|
||||
// hop, line 30
|
||||
{
|
||||
int c = cursor + 3;
|
||||
if (0 > c || c > limit)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cursor = c;
|
||||
}
|
||||
// setmark x, line 30
|
||||
I_x = cursor;
|
||||
cursor = v_1;
|
||||
// goto, line 31
|
||||
golab0: while(true)
|
||||
{
|
||||
v_2 = cursor;
|
||||
lab1: do {
|
||||
if (!(in_grouping(g_v, 97, 248)))
|
||||
// (, line 26
|
||||
I_p1 = limit;
|
||||
// test, line 30
|
||||
v_1 = cursor;
|
||||
// (, line 30
|
||||
// hop, line 30
|
||||
{
|
||||
break lab1;
|
||||
int c = cursor + 3;
|
||||
if (0 > c || c > limit)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cursor = c;
|
||||
}
|
||||
cursor = v_2;
|
||||
break golab0;
|
||||
} while (false);
|
||||
cursor = v_2;
|
||||
if (cursor >= limit)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cursor++;
|
||||
}
|
||||
// gopast, line 31
|
||||
golab2: while(true)
|
||||
{
|
||||
lab3: do {
|
||||
if (!(out_grouping(g_v, 97, 248)))
|
||||
// setmark x, line 30
|
||||
I_x = cursor;
|
||||
cursor = v_1;
|
||||
// goto, line 31
|
||||
golab0: while(true)
|
||||
{
|
||||
break lab3;
|
||||
}
|
||||
break golab2;
|
||||
} while (false);
|
||||
if (cursor >= limit)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cursor++;
|
||||
}
|
||||
// setmark p1, line 31
|
||||
I_p1 = cursor;
|
||||
// try, line 32
|
||||
lab4: do {
|
||||
// (, line 32
|
||||
if (!(I_p1 < I_x))
|
||||
{
|
||||
break lab4;
|
||||
}
|
||||
I_p1 = I_x;
|
||||
} while (false);
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean r_main_suffix() {
|
||||
int among_var;
|
||||
int v_1;
|
||||
int v_2;
|
||||
int v_3;
|
||||
// (, line 37
|
||||
// setlimit, line 38
|
||||
v_1 = limit - cursor;
|
||||
// tomark, line 38
|
||||
if (cursor < I_p1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cursor = I_p1;
|
||||
v_2 = limit_backward;
|
||||
limit_backward = cursor;
|
||||
cursor = limit - v_1;
|
||||
// (, line 38
|
||||
// [, line 38
|
||||
ket = cursor;
|
||||
// substring, line 38
|
||||
among_var = find_among_b(a_0, 29);
|
||||
if (among_var == 0)
|
||||
{
|
||||
limit_backward = v_2;
|
||||
return false;
|
||||
}
|
||||
// ], line 38
|
||||
bra = cursor;
|
||||
limit_backward = v_2;
|
||||
switch(among_var) {
|
||||
case 0:
|
||||
return false;
|
||||
case 1:
|
||||
// (, line 44
|
||||
// delete, line 44
|
||||
slice_del();
|
||||
break;
|
||||
case 2:
|
||||
// (, line 46
|
||||
// or, line 46
|
||||
lab0: do {
|
||||
v_3 = limit - cursor;
|
||||
v_2 = cursor;
|
||||
lab1: do {
|
||||
if (!(in_grouping_b(g_s_ending, 98, 122)))
|
||||
if (!(in_grouping(g_v, 97, 248)))
|
||||
{
|
||||
break lab1;
|
||||
}
|
||||
break lab0;
|
||||
cursor = v_2;
|
||||
break golab0;
|
||||
} while (false);
|
||||
cursor = limit - v_3;
|
||||
// (, line 46
|
||||
// literal, line 46
|
||||
if (!(eq_s_b(1, "k")))
|
||||
cursor = v_2;
|
||||
if (cursor >= limit)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (!(out_grouping_b(g_v, 97, 248)))
|
||||
cursor++;
|
||||
}
|
||||
// gopast, line 31
|
||||
golab2: while(true)
|
||||
{
|
||||
lab3: do {
|
||||
if (!(out_grouping(g_v, 97, 248)))
|
||||
{
|
||||
break lab3;
|
||||
}
|
||||
break golab2;
|
||||
} while (false);
|
||||
if (cursor >= limit)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cursor++;
|
||||
}
|
||||
// setmark p1, line 31
|
||||
I_p1 = cursor;
|
||||
// try, line 32
|
||||
lab4: do {
|
||||
// (, line 32
|
||||
if (!(I_p1 < I_x))
|
||||
{
|
||||
break lab4;
|
||||
}
|
||||
I_p1 = I_x;
|
||||
} while (false);
|
||||
// delete, line 46
|
||||
slice_del();
|
||||
break;
|
||||
case 3:
|
||||
// (, line 48
|
||||
// <-, line 48
|
||||
slice_from("er");
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean r_consonant_pair() {
|
||||
int v_1;
|
||||
int v_2;
|
||||
int v_3;
|
||||
// (, line 52
|
||||
// test, line 53
|
||||
v_1 = limit - cursor;
|
||||
// (, line 53
|
||||
// setlimit, line 54
|
||||
v_2 = limit - cursor;
|
||||
// tomark, line 54
|
||||
if (cursor < I_p1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cursor = I_p1;
|
||||
v_3 = limit_backward;
|
||||
limit_backward = cursor;
|
||||
cursor = limit - v_2;
|
||||
// (, line 54
|
||||
// [, line 54
|
||||
ket = cursor;
|
||||
// substring, line 54
|
||||
if (find_among_b(a_1, 2) == 0)
|
||||
{
|
||||
limit_backward = v_3;
|
||||
return false;
|
||||
}
|
||||
// ], line 54
|
||||
bra = cursor;
|
||||
limit_backward = v_3;
|
||||
cursor = limit - v_1;
|
||||
// next, line 59
|
||||
if (cursor <= limit_backward)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cursor--;
|
||||
// ], line 59
|
||||
bra = cursor;
|
||||
// delete, line 59
|
||||
slice_del();
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean r_other_suffix() {
|
||||
private boolean r_main_suffix() {
|
||||
int among_var;
|
||||
int v_1;
|
||||
int v_2;
|
||||
// (, line 62
|
||||
// setlimit, line 63
|
||||
v_1 = limit - cursor;
|
||||
// tomark, line 63
|
||||
if (cursor < I_p1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cursor = I_p1;
|
||||
v_2 = limit_backward;
|
||||
limit_backward = cursor;
|
||||
cursor = limit - v_1;
|
||||
// (, line 63
|
||||
// [, line 63
|
||||
ket = cursor;
|
||||
// substring, line 63
|
||||
among_var = find_among_b(a_2, 11);
|
||||
if (among_var == 0)
|
||||
{
|
||||
limit_backward = v_2;
|
||||
return false;
|
||||
}
|
||||
// ], line 63
|
||||
bra = cursor;
|
||||
limit_backward = v_2;
|
||||
switch(among_var) {
|
||||
case 0:
|
||||
return false;
|
||||
case 1:
|
||||
// (, line 67
|
||||
// delete, line 67
|
||||
slice_del();
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
int v_3;
|
||||
// (, line 37
|
||||
// setlimit, line 38
|
||||
v_1 = limit - cursor;
|
||||
// tomark, line 38
|
||||
if (cursor < I_p1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cursor = I_p1;
|
||||
v_2 = limit_backward;
|
||||
limit_backward = cursor;
|
||||
cursor = limit - v_1;
|
||||
// (, line 38
|
||||
// [, line 38
|
||||
ket = cursor;
|
||||
// substring, line 38
|
||||
among_var = find_among_b(a_0, 29);
|
||||
if (among_var == 0)
|
||||
{
|
||||
limit_backward = v_2;
|
||||
return false;
|
||||
}
|
||||
// ], line 38
|
||||
bra = cursor;
|
||||
limit_backward = v_2;
|
||||
switch(among_var) {
|
||||
case 0:
|
||||
return false;
|
||||
case 1:
|
||||
// (, line 44
|
||||
// delete, line 44
|
||||
slice_del();
|
||||
break;
|
||||
case 2:
|
||||
// (, line 46
|
||||
// or, line 46
|
||||
lab0: do {
|
||||
v_3 = limit - cursor;
|
||||
lab1: do {
|
||||
if (!(in_grouping_b(g_s_ending, 98, 122)))
|
||||
{
|
||||
break lab1;
|
||||
}
|
||||
break lab0;
|
||||
} while (false);
|
||||
cursor = limit - v_3;
|
||||
// (, line 46
|
||||
// literal, line 46
|
||||
if (!(eq_s_b(1, "k")))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (!(out_grouping_b(g_v, 97, 248)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
} while (false);
|
||||
// delete, line 46
|
||||
slice_del();
|
||||
break;
|
||||
case 3:
|
||||
// (, line 48
|
||||
// <-, line 48
|
||||
slice_from("er");
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean stem() {
|
||||
private boolean r_consonant_pair() {
|
||||
int v_1;
|
||||
int v_2;
|
||||
int v_3;
|
||||
// (, line 52
|
||||
// test, line 53
|
||||
v_1 = limit - cursor;
|
||||
// (, line 53
|
||||
// setlimit, line 54
|
||||
v_2 = limit - cursor;
|
||||
// tomark, line 54
|
||||
if (cursor < I_p1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cursor = I_p1;
|
||||
v_3 = limit_backward;
|
||||
limit_backward = cursor;
|
||||
cursor = limit - v_2;
|
||||
// (, line 54
|
||||
// [, line 54
|
||||
ket = cursor;
|
||||
// substring, line 54
|
||||
if (find_among_b(a_1, 2) == 0)
|
||||
{
|
||||
limit_backward = v_3;
|
||||
return false;
|
||||
}
|
||||
// ], line 54
|
||||
bra = cursor;
|
||||
limit_backward = v_3;
|
||||
cursor = limit - v_1;
|
||||
// next, line 59
|
||||
if (cursor <= limit_backward)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cursor--;
|
||||
// ], line 59
|
||||
bra = cursor;
|
||||
// delete, line 59
|
||||
slice_del();
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean r_other_suffix() {
|
||||
int among_var;
|
||||
int v_1;
|
||||
int v_2;
|
||||
// (, line 62
|
||||
// setlimit, line 63
|
||||
v_1 = limit - cursor;
|
||||
// tomark, line 63
|
||||
if (cursor < I_p1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cursor = I_p1;
|
||||
v_2 = limit_backward;
|
||||
limit_backward = cursor;
|
||||
cursor = limit - v_1;
|
||||
// (, line 63
|
||||
// [, line 63
|
||||
ket = cursor;
|
||||
// substring, line 63
|
||||
among_var = find_among_b(a_2, 11);
|
||||
if (among_var == 0)
|
||||
{
|
||||
limit_backward = v_2;
|
||||
return false;
|
||||
}
|
||||
// ], line 63
|
||||
bra = cursor;
|
||||
limit_backward = v_2;
|
||||
switch(among_var) {
|
||||
case 0:
|
||||
return false;
|
||||
case 1:
|
||||
// (, line 67
|
||||
// delete, line 67
|
||||
slice_del();
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean stem() {
|
||||
int v_1;
|
||||
int v_2;
|
||||
int v_3;
|
||||
int v_4;
|
||||
// (, line 72
|
||||
// do, line 74
|
||||
v_1 = cursor;
|
||||
lab0: do {
|
||||
// call mark_regions, line 74
|
||||
if (!r_mark_regions())
|
||||
{
|
||||
break lab0;
|
||||
// (, line 72
|
||||
// do, line 74
|
||||
v_1 = cursor;
|
||||
lab0: do {
|
||||
// call mark_regions, line 74
|
||||
if (!r_mark_regions())
|
||||
{
|
||||
break lab0;
|
||||
}
|
||||
} while (false);
|
||||
cursor = v_1;
|
||||
// backwards, line 75
|
||||
limit_backward = cursor; cursor = limit;
|
||||
// (, line 75
|
||||
// do, line 76
|
||||
v_2 = limit - cursor;
|
||||
lab1: do {
|
||||
// call main_suffix, line 76
|
||||
if (!r_main_suffix())
|
||||
{
|
||||
break lab1;
|
||||
}
|
||||
} while (false);
|
||||
cursor = limit - v_2;
|
||||
// do, line 77
|
||||
v_3 = limit - cursor;
|
||||
lab2: do {
|
||||
// call consonant_pair, line 77
|
||||
if (!r_consonant_pair())
|
||||
{
|
||||
break lab2;
|
||||
}
|
||||
} while (false);
|
||||
cursor = limit - v_3;
|
||||
// do, line 78
|
||||
v_4 = limit - cursor;
|
||||
lab3: do {
|
||||
// call other_suffix, line 78
|
||||
if (!r_other_suffix())
|
||||
{
|
||||
break lab3;
|
||||
}
|
||||
} while (false);
|
||||
cursor = limit - v_4;
|
||||
cursor = limit_backward; return true;
|
||||
}
|
||||
} while (false);
|
||||
cursor = v_1;
|
||||
// backwards, line 75
|
||||
limit_backward = cursor; cursor = limit;
|
||||
// (, line 75
|
||||
// do, line 76
|
||||
v_2 = limit - cursor;
|
||||
lab1: do {
|
||||
// call main_suffix, line 76
|
||||
if (!r_main_suffix())
|
||||
{
|
||||
break lab1;
|
||||
}
|
||||
} while (false);
|
||||
cursor = limit - v_2;
|
||||
// do, line 77
|
||||
v_3 = limit - cursor;
|
||||
lab2: do {
|
||||
// call consonant_pair, line 77
|
||||
if (!r_consonant_pair())
|
||||
{
|
||||
break lab2;
|
||||
}
|
||||
} while (false);
|
||||
cursor = limit - v_3;
|
||||
// do, line 78
|
||||
v_4 = limit - cursor;
|
||||
lab3: do {
|
||||
// call other_suffix, line 78
|
||||
if (!r_other_suffix())
|
||||
{
|
||||
break lab3;
|
||||
}
|
||||
} while (false);
|
||||
cursor = limit - v_4;
|
||||
cursor = limit_backward; return true;
|
||||
|
||||
public boolean equals( Object o ) {
|
||||
return o instanceof NorwegianStemmer;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return NorwegianStemmer.class.getName().hashCode();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,349 +1,366 @@
|
|||
// This file was generated automatically by the Snowball to Java compiler
|
||||
|
||||
package org.tartarus.snowball.ext;
|
||||
import org.tartarus.snowball.SnowballProgram;
|
||||
import org.tartarus.snowball.Among;
|
||||
|
||||
/**
|
||||
* Generated class implementing code defined by a snowball script.
|
||||
*/
|
||||
import org.tartarus.snowball.Among;
|
||||
import org.tartarus.snowball.SnowballProgram;
|
||||
|
||||
/**
|
||||
* This class was automatically generated by a Snowball to Java compiler
|
||||
* It implements the stemming algorithm defined by a snowball script.
|
||||
*/
|
||||
|
||||
public class SwedishStemmer extends SnowballProgram {
|
||||
|
||||
private Among a_0[] = {
|
||||
new Among ( "a", -1, 1, "", this),
|
||||
new Among ( "arna", 0, 1, "", this),
|
||||
new Among ( "erna", 0, 1, "", this),
|
||||
new Among ( "heterna", 2, 1, "", this),
|
||||
new Among ( "orna", 0, 1, "", this),
|
||||
new Among ( "ad", -1, 1, "", this),
|
||||
new Among ( "e", -1, 1, "", this),
|
||||
new Among ( "ade", 6, 1, "", this),
|
||||
new Among ( "ande", 6, 1, "", this),
|
||||
new Among ( "arne", 6, 1, "", this),
|
||||
new Among ( "are", 6, 1, "", this),
|
||||
new Among ( "aste", 6, 1, "", this),
|
||||
new Among ( "en", -1, 1, "", this),
|
||||
new Among ( "anden", 12, 1, "", this),
|
||||
new Among ( "aren", 12, 1, "", this),
|
||||
new Among ( "heten", 12, 1, "", this),
|
||||
new Among ( "ern", -1, 1, "", this),
|
||||
new Among ( "ar", -1, 1, "", this),
|
||||
new Among ( "er", -1, 1, "", this),
|
||||
new Among ( "heter", 18, 1, "", this),
|
||||
new Among ( "or", -1, 1, "", this),
|
||||
new Among ( "s", -1, 2, "", this),
|
||||
new Among ( "as", 21, 1, "", this),
|
||||
new Among ( "arnas", 22, 1, "", this),
|
||||
new Among ( "ernas", 22, 1, "", this),
|
||||
new Among ( "ornas", 22, 1, "", this),
|
||||
new Among ( "es", 21, 1, "", this),
|
||||
new Among ( "ades", 26, 1, "", this),
|
||||
new Among ( "andes", 26, 1, "", this),
|
||||
new Among ( "ens", 21, 1, "", this),
|
||||
new Among ( "arens", 29, 1, "", this),
|
||||
new Among ( "hetens", 29, 1, "", this),
|
||||
new Among ( "erns", 21, 1, "", this),
|
||||
new Among ( "at", -1, 1, "", this),
|
||||
new Among ( "andet", -1, 1, "", this),
|
||||
new Among ( "het", -1, 1, "", this),
|
||||
new Among ( "ast", -1, 1, "", this)
|
||||
};
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Among a_1[] = {
|
||||
new Among ( "dd", -1, -1, "", this),
|
||||
new Among ( "gd", -1, -1, "", this),
|
||||
new Among ( "nn", -1, -1, "", this),
|
||||
new Among ( "dt", -1, -1, "", this),
|
||||
new Among ( "gt", -1, -1, "", this),
|
||||
new Among ( "kt", -1, -1, "", this),
|
||||
new Among ( "tt", -1, -1, "", this)
|
||||
};
|
||||
private final static SwedishStemmer methodObject = new SwedishStemmer ();
|
||||
|
||||
private Among a_2[] = {
|
||||
new Among ( "ig", -1, 1, "", this),
|
||||
new Among ( "lig", 0, 1, "", this),
|
||||
new Among ( "els", -1, 1, "", this),
|
||||
new Among ( "fullt", -1, 3, "", this),
|
||||
new Among ( "l\u00F6st", -1, 2, "", this)
|
||||
};
|
||||
private final static Among a_0[] = {
|
||||
new Among ( "a", -1, 1, "", methodObject ),
|
||||
new Among ( "arna", 0, 1, "", methodObject ),
|
||||
new Among ( "erna", 0, 1, "", methodObject ),
|
||||
new Among ( "heterna", 2, 1, "", methodObject ),
|
||||
new Among ( "orna", 0, 1, "", methodObject ),
|
||||
new Among ( "ad", -1, 1, "", methodObject ),
|
||||
new Among ( "e", -1, 1, "", methodObject ),
|
||||
new Among ( "ade", 6, 1, "", methodObject ),
|
||||
new Among ( "ande", 6, 1, "", methodObject ),
|
||||
new Among ( "arne", 6, 1, "", methodObject ),
|
||||
new Among ( "are", 6, 1, "", methodObject ),
|
||||
new Among ( "aste", 6, 1, "", methodObject ),
|
||||
new Among ( "en", -1, 1, "", methodObject ),
|
||||
new Among ( "anden", 12, 1, "", methodObject ),
|
||||
new Among ( "aren", 12, 1, "", methodObject ),
|
||||
new Among ( "heten", 12, 1, "", methodObject ),
|
||||
new Among ( "ern", -1, 1, "", methodObject ),
|
||||
new Among ( "ar", -1, 1, "", methodObject ),
|
||||
new Among ( "er", -1, 1, "", methodObject ),
|
||||
new Among ( "heter", 18, 1, "", methodObject ),
|
||||
new Among ( "or", -1, 1, "", methodObject ),
|
||||
new Among ( "s", -1, 2, "", methodObject ),
|
||||
new Among ( "as", 21, 1, "", methodObject ),
|
||||
new Among ( "arnas", 22, 1, "", methodObject ),
|
||||
new Among ( "ernas", 22, 1, "", methodObject ),
|
||||
new Among ( "ornas", 22, 1, "", methodObject ),
|
||||
new Among ( "es", 21, 1, "", methodObject ),
|
||||
new Among ( "ades", 26, 1, "", methodObject ),
|
||||
new Among ( "andes", 26, 1, "", methodObject ),
|
||||
new Among ( "ens", 21, 1, "", methodObject ),
|
||||
new Among ( "arens", 29, 1, "", methodObject ),
|
||||
new Among ( "hetens", 29, 1, "", methodObject ),
|
||||
new Among ( "erns", 21, 1, "", methodObject ),
|
||||
new Among ( "at", -1, 1, "", methodObject ),
|
||||
new Among ( "andet", -1, 1, "", methodObject ),
|
||||
new Among ( "het", -1, 1, "", methodObject ),
|
||||
new Among ( "ast", -1, 1, "", methodObject )
|
||||
};
|
||||
|
||||
private static final char g_v[] = {17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 32 };
|
||||
private final static Among a_1[] = {
|
||||
new Among ( "dd", -1, -1, "", methodObject ),
|
||||
new Among ( "gd", -1, -1, "", methodObject ),
|
||||
new Among ( "nn", -1, -1, "", methodObject ),
|
||||
new Among ( "dt", -1, -1, "", methodObject ),
|
||||
new Among ( "gt", -1, -1, "", methodObject ),
|
||||
new Among ( "kt", -1, -1, "", methodObject ),
|
||||
new Among ( "tt", -1, -1, "", methodObject )
|
||||
};
|
||||
|
||||
private static final char g_s_ending[] = {119, 127, 149 };
|
||||
private final static Among a_2[] = {
|
||||
new Among ( "ig", -1, 1, "", methodObject ),
|
||||
new Among ( "lig", 0, 1, "", methodObject ),
|
||||
new Among ( "els", -1, 1, "", methodObject ),
|
||||
new Among ( "fullt", -1, 3, "", methodObject ),
|
||||
new Among ( "l\u00F6st", -1, 2, "", methodObject )
|
||||
};
|
||||
|
||||
private static final char g_v[] = {17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 32 };
|
||||
|
||||
private static final char g_s_ending[] = {119, 127, 149 };
|
||||
|
||||
private int I_x;
|
||||
private int I_p1;
|
||||
|
||||
private void copy_from(SwedishStemmer other) {
|
||||
I_x = other.I_x;
|
||||
I_p1 = other.I_p1;
|
||||
super.copy_from(other);
|
||||
}
|
||||
private void copy_from(SwedishStemmer other) {
|
||||
I_x = other.I_x;
|
||||
I_p1 = other.I_p1;
|
||||
super.copy_from(other);
|
||||
}
|
||||
|
||||
private boolean r_mark_regions() {
|
||||
private boolean r_mark_regions() {
|
||||
int v_1;
|
||||
int v_2;
|
||||
// (, line 26
|
||||
I_p1 = limit;
|
||||
// test, line 29
|
||||
v_1 = cursor;
|
||||
// (, line 29
|
||||
// hop, line 29
|
||||
{
|
||||
int c = cursor + 3;
|
||||
if (0 > c || c > limit)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cursor = c;
|
||||
}
|
||||
// setmark x, line 29
|
||||
I_x = cursor;
|
||||
cursor = v_1;
|
||||
// goto, line 30
|
||||
golab0: while(true)
|
||||
{
|
||||
v_2 = cursor;
|
||||
lab1: do {
|
||||
if (!(in_grouping(g_v, 97, 246)))
|
||||
// (, line 26
|
||||
I_p1 = limit;
|
||||
// test, line 29
|
||||
v_1 = cursor;
|
||||
// (, line 29
|
||||
// hop, line 29
|
||||
{
|
||||
break lab1;
|
||||
int c = cursor + 3;
|
||||
if (0 > c || c > limit)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cursor = c;
|
||||
}
|
||||
cursor = v_2;
|
||||
break golab0;
|
||||
} while (false);
|
||||
cursor = v_2;
|
||||
if (cursor >= limit)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cursor++;
|
||||
}
|
||||
// gopast, line 30
|
||||
golab2: while(true)
|
||||
{
|
||||
lab3: do {
|
||||
if (!(out_grouping(g_v, 97, 246)))
|
||||
// setmark x, line 29
|
||||
I_x = cursor;
|
||||
cursor = v_1;
|
||||
// goto, line 30
|
||||
golab0: while(true)
|
||||
{
|
||||
break lab3;
|
||||
v_2 = cursor;
|
||||
lab1: do {
|
||||
if (!(in_grouping(g_v, 97, 246)))
|
||||
{
|
||||
break lab1;
|
||||
}
|
||||
cursor = v_2;
|
||||
break golab0;
|
||||
} while (false);
|
||||
cursor = v_2;
|
||||
if (cursor >= limit)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cursor++;
|
||||
}
|
||||
break golab2;
|
||||
} while (false);
|
||||
if (cursor >= limit)
|
||||
{
|
||||
return false;
|
||||
// gopast, line 30
|
||||
golab2: while(true)
|
||||
{
|
||||
lab3: do {
|
||||
if (!(out_grouping(g_v, 97, 246)))
|
||||
{
|
||||
break lab3;
|
||||
}
|
||||
break golab2;
|
||||
} while (false);
|
||||
if (cursor >= limit)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cursor++;
|
||||
}
|
||||
// setmark p1, line 30
|
||||
I_p1 = cursor;
|
||||
// try, line 31
|
||||
lab4: do {
|
||||
// (, line 31
|
||||
if (!(I_p1 < I_x))
|
||||
{
|
||||
break lab4;
|
||||
}
|
||||
I_p1 = I_x;
|
||||
} while (false);
|
||||
return true;
|
||||
}
|
||||
cursor++;
|
||||
}
|
||||
// setmark p1, line 30
|
||||
I_p1 = cursor;
|
||||
// try, line 31
|
||||
lab4: do {
|
||||
// (, line 31
|
||||
if (!(I_p1 < I_x))
|
||||
{
|
||||
break lab4;
|
||||
}
|
||||
I_p1 = I_x;
|
||||
} while (false);
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean r_main_suffix() {
|
||||
private boolean r_main_suffix() {
|
||||
int among_var;
|
||||
int v_1;
|
||||
int v_2;
|
||||
// (, line 36
|
||||
// setlimit, line 37
|
||||
v_1 = limit - cursor;
|
||||
// tomark, line 37
|
||||
if (cursor < I_p1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cursor = I_p1;
|
||||
v_2 = limit_backward;
|
||||
limit_backward = cursor;
|
||||
cursor = limit - v_1;
|
||||
// (, line 37
|
||||
// [, line 37
|
||||
ket = cursor;
|
||||
// substring, line 37
|
||||
among_var = find_among_b(a_0, 37);
|
||||
if (among_var == 0)
|
||||
{
|
||||
limit_backward = v_2;
|
||||
return false;
|
||||
}
|
||||
// ], line 37
|
||||
bra = cursor;
|
||||
limit_backward = v_2;
|
||||
switch(among_var) {
|
||||
case 0:
|
||||
return false;
|
||||
case 1:
|
||||
// (, line 44
|
||||
// delete, line 44
|
||||
slice_del();
|
||||
break;
|
||||
case 2:
|
||||
// (, line 46
|
||||
if (!(in_grouping_b(g_s_ending, 98, 121)))
|
||||
// (, line 36
|
||||
// setlimit, line 37
|
||||
v_1 = limit - cursor;
|
||||
// tomark, line 37
|
||||
if (cursor < I_p1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// delete, line 46
|
||||
slice_del();
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
cursor = I_p1;
|
||||
v_2 = limit_backward;
|
||||
limit_backward = cursor;
|
||||
cursor = limit - v_1;
|
||||
// (, line 37
|
||||
// [, line 37
|
||||
ket = cursor;
|
||||
// substring, line 37
|
||||
among_var = find_among_b(a_0, 37);
|
||||
if (among_var == 0)
|
||||
{
|
||||
limit_backward = v_2;
|
||||
return false;
|
||||
}
|
||||
// ], line 37
|
||||
bra = cursor;
|
||||
limit_backward = v_2;
|
||||
switch(among_var) {
|
||||
case 0:
|
||||
return false;
|
||||
case 1:
|
||||
// (, line 44
|
||||
// delete, line 44
|
||||
slice_del();
|
||||
break;
|
||||
case 2:
|
||||
// (, line 46
|
||||
if (!(in_grouping_b(g_s_ending, 98, 121)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// delete, line 46
|
||||
slice_del();
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean r_consonant_pair() {
|
||||
private boolean r_consonant_pair() {
|
||||
int v_1;
|
||||
int v_2;
|
||||
int v_3;
|
||||
// setlimit, line 50
|
||||
v_1 = limit - cursor;
|
||||
// tomark, line 50
|
||||
if (cursor < I_p1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cursor = I_p1;
|
||||
v_2 = limit_backward;
|
||||
limit_backward = cursor;
|
||||
cursor = limit - v_1;
|
||||
// (, line 50
|
||||
// and, line 52
|
||||
v_3 = limit - cursor;
|
||||
// among, line 51
|
||||
if (find_among_b(a_1, 7) == 0)
|
||||
{
|
||||
limit_backward = v_2;
|
||||
return false;
|
||||
}
|
||||
cursor = limit - v_3;
|
||||
// (, line 52
|
||||
// [, line 52
|
||||
ket = cursor;
|
||||
// next, line 52
|
||||
if (cursor <= limit_backward)
|
||||
{
|
||||
limit_backward = v_2;
|
||||
return false;
|
||||
}
|
||||
cursor--;
|
||||
// ], line 52
|
||||
bra = cursor;
|
||||
// delete, line 52
|
||||
slice_del();
|
||||
limit_backward = v_2;
|
||||
return true;
|
||||
}
|
||||
// setlimit, line 50
|
||||
v_1 = limit - cursor;
|
||||
// tomark, line 50
|
||||
if (cursor < I_p1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cursor = I_p1;
|
||||
v_2 = limit_backward;
|
||||
limit_backward = cursor;
|
||||
cursor = limit - v_1;
|
||||
// (, line 50
|
||||
// and, line 52
|
||||
v_3 = limit - cursor;
|
||||
// among, line 51
|
||||
if (find_among_b(a_1, 7) == 0)
|
||||
{
|
||||
limit_backward = v_2;
|
||||
return false;
|
||||
}
|
||||
cursor = limit - v_3;
|
||||
// (, line 52
|
||||
// [, line 52
|
||||
ket = cursor;
|
||||
// next, line 52
|
||||
if (cursor <= limit_backward)
|
||||
{
|
||||
limit_backward = v_2;
|
||||
return false;
|
||||
}
|
||||
cursor--;
|
||||
// ], line 52
|
||||
bra = cursor;
|
||||
// delete, line 52
|
||||
slice_del();
|
||||
limit_backward = v_2;
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean r_other_suffix() {
|
||||
private boolean r_other_suffix() {
|
||||
int among_var;
|
||||
int v_1;
|
||||
int v_2;
|
||||
// setlimit, line 55
|
||||
v_1 = limit - cursor;
|
||||
// tomark, line 55
|
||||
if (cursor < I_p1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cursor = I_p1;
|
||||
v_2 = limit_backward;
|
||||
limit_backward = cursor;
|
||||
cursor = limit - v_1;
|
||||
// (, line 55
|
||||
// [, line 56
|
||||
ket = cursor;
|
||||
// substring, line 56
|
||||
among_var = find_among_b(a_2, 5);
|
||||
if (among_var == 0)
|
||||
{
|
||||
limit_backward = v_2;
|
||||
return false;
|
||||
}
|
||||
// ], line 56
|
||||
bra = cursor;
|
||||
switch(among_var) {
|
||||
case 0:
|
||||
// setlimit, line 55
|
||||
v_1 = limit - cursor;
|
||||
// tomark, line 55
|
||||
if (cursor < I_p1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cursor = I_p1;
|
||||
v_2 = limit_backward;
|
||||
limit_backward = cursor;
|
||||
cursor = limit - v_1;
|
||||
// (, line 55
|
||||
// [, line 56
|
||||
ket = cursor;
|
||||
// substring, line 56
|
||||
among_var = find_among_b(a_2, 5);
|
||||
if (among_var == 0)
|
||||
{
|
||||
limit_backward = v_2;
|
||||
return false;
|
||||
}
|
||||
// ], line 56
|
||||
bra = cursor;
|
||||
switch(among_var) {
|
||||
case 0:
|
||||
limit_backward = v_2;
|
||||
return false;
|
||||
case 1:
|
||||
// (, line 57
|
||||
// delete, line 57
|
||||
slice_del();
|
||||
break;
|
||||
case 2:
|
||||
// (, line 58
|
||||
// <-, line 58
|
||||
slice_from("l\u00F6s");
|
||||
break;
|
||||
case 3:
|
||||
// (, line 59
|
||||
// <-, line 59
|
||||
slice_from("full");
|
||||
break;
|
||||
}
|
||||
limit_backward = v_2;
|
||||
return false;
|
||||
case 1:
|
||||
// (, line 57
|
||||
// delete, line 57
|
||||
slice_del();
|
||||
break;
|
||||
case 2:
|
||||
// (, line 58
|
||||
// <-, line 58
|
||||
slice_from("l\u00F6s");
|
||||
break;
|
||||
case 3:
|
||||
// (, line 59
|
||||
// <-, line 59
|
||||
slice_from("full");
|
||||
break;
|
||||
}
|
||||
limit_backward = v_2;
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean stem() {
|
||||
public boolean stem() {
|
||||
int v_1;
|
||||
int v_2;
|
||||
int v_3;
|
||||
int v_4;
|
||||
// (, line 64
|
||||
// do, line 66
|
||||
v_1 = cursor;
|
||||
lab0: do {
|
||||
// call mark_regions, line 66
|
||||
if (!r_mark_regions())
|
||||
{
|
||||
break lab0;
|
||||
// (, line 64
|
||||
// do, line 66
|
||||
v_1 = cursor;
|
||||
lab0: do {
|
||||
// call mark_regions, line 66
|
||||
if (!r_mark_regions())
|
||||
{
|
||||
break lab0;
|
||||
}
|
||||
} while (false);
|
||||
cursor = v_1;
|
||||
// backwards, line 67
|
||||
limit_backward = cursor; cursor = limit;
|
||||
// (, line 67
|
||||
// do, line 68
|
||||
v_2 = limit - cursor;
|
||||
lab1: do {
|
||||
// call main_suffix, line 68
|
||||
if (!r_main_suffix())
|
||||
{
|
||||
break lab1;
|
||||
}
|
||||
} while (false);
|
||||
cursor = limit - v_2;
|
||||
// do, line 69
|
||||
v_3 = limit - cursor;
|
||||
lab2: do {
|
||||
// call consonant_pair, line 69
|
||||
if (!r_consonant_pair())
|
||||
{
|
||||
break lab2;
|
||||
}
|
||||
} while (false);
|
||||
cursor = limit - v_3;
|
||||
// do, line 70
|
||||
v_4 = limit - cursor;
|
||||
lab3: do {
|
||||
// call other_suffix, line 70
|
||||
if (!r_other_suffix())
|
||||
{
|
||||
break lab3;
|
||||
}
|
||||
} while (false);
|
||||
cursor = limit - v_4;
|
||||
cursor = limit_backward; return true;
|
||||
}
|
||||
} while (false);
|
||||
cursor = v_1;
|
||||
// backwards, line 67
|
||||
limit_backward = cursor; cursor = limit;
|
||||
// (, line 67
|
||||
// do, line 68
|
||||
v_2 = limit - cursor;
|
||||
lab1: do {
|
||||
// call main_suffix, line 68
|
||||
if (!r_main_suffix())
|
||||
{
|
||||
break lab1;
|
||||
}
|
||||
} while (false);
|
||||
cursor = limit - v_2;
|
||||
// do, line 69
|
||||
v_3 = limit - cursor;
|
||||
lab2: do {
|
||||
// call consonant_pair, line 69
|
||||
if (!r_consonant_pair())
|
||||
{
|
||||
break lab2;
|
||||
}
|
||||
} while (false);
|
||||
cursor = limit - v_3;
|
||||
// do, line 70
|
||||
v_4 = limit - cursor;
|
||||
lab3: do {
|
||||
// call other_suffix, line 70
|
||||
if (!r_other_suffix())
|
||||
{
|
||||
break lab3;
|
||||
}
|
||||
} while (false);
|
||||
cursor = limit - v_4;
|
||||
cursor = limit_backward; return true;
|
||||
|
||||
public boolean equals( Object o ) {
|
||||
return o instanceof SwedishStemmer;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return SwedishStemmer.class.getName().hashCode();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -25,6 +25,7 @@ import org.apache.lucene.analysis.Analyzer;
|
|||
import org.apache.lucene.analysis.MockTokenizer;
|
||||
import org.apache.lucene.analysis.Tokenizer;
|
||||
import org.apache.lucene.analysis.TokenStream;
|
||||
import org.apache.lucene.analysis.Analyzer.TokenStreamComponents;
|
||||
import org.apache.lucene.analysis.core.KeywordTokenizer;
|
||||
import org.apache.lucene.analysis.standard.StandardAnalyzer;
|
||||
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
|
||||
|
@ -116,4 +117,21 @@ public class TestSnowball extends BaseTokenStreamTestCase {
|
|||
checkOneTermReuse(a, "", "");
|
||||
}
|
||||
}
|
||||
|
||||
public void testRandomStrings() throws IOException {
|
||||
for (String lang : SNOWBALL_LANGS) {
|
||||
checkRandomStrings(lang);
|
||||
}
|
||||
}
|
||||
|
||||
public void checkRandomStrings(final String snowballLanguage) throws IOException {
|
||||
Analyzer a = new Analyzer() {
|
||||
@Override
|
||||
protected TokenStreamComponents createComponents(String fieldName, Reader reader) {
|
||||
Tokenizer t = new MockTokenizer(reader);
|
||||
return new TokenStreamComponents(t, new SnowballFilter(t, snowballLanguage));
|
||||
}
|
||||
};
|
||||
checkRandomData(random(), a, 1000*RANDOM_MULTIPLIER);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue