Commit 1d5f4d40 authored by Olly Betts's avatar Olly Betts
Browse files

Use "substring" in kraaij_pohlmann stemmer

Make this stemmer use the same construct as the others:

    [substring] among (
        // cases
    )

rather than:

    [among ( (])
        // cases
    )

The second version seems more cryptic, and I suspect dates back to
before substring was added to the language.

Both result in almost identical code being generated - aside from
different comments, the only difference is that the new version avoids
an interim assignment to among_var in one case which is arguably better
though the compiler will probably optimise both versions to the same
machine code.
parent e3879842
......@@ -44,7 +44,7 @@ backwardmode (
define Step_1 as
(
[among ( (])
[substring] among (
'{'}s' (delete)
's' (R1 not ('t' R1) C delete)
......@@ -66,7 +66,7 @@ backwardmode (
define Step_2 as
(
[among ( (])
[substring] among (
'je' (('{'}t' ] delete) or
('et' ] R1 C delete) or
('rnt' ] <-'rn') or
......@@ -90,7 +90,7 @@ backwardmode (
define Step_3 as
(
[among ( (])
[substring] among (
'atie' (R1 <-'eer')
'iteit' (R1 delete lengthen_V)
'heid'
......@@ -110,7 +110,7 @@ backwardmode (
define Step_4 as
(
( [among ( (])
( [substring] among (
'ioneel' (R1 <-'ie')
'atief' (R1 <-'eer')
'baar' (R1 delete)
......@@ -130,7 +130,7 @@ backwardmode (
)
)
or
( [among ( (])
( [substring] among (
'iger'
'igst'
'ig' (R1 C delete lengthen_V)
......@@ -140,7 +140,7 @@ backwardmode (
define Step_7 as
(
[among ( (])
[substring] among (
'kt' (<-'k')
'ft' (<-'f')
'pt' (<-'p')
......@@ -149,7 +149,7 @@ backwardmode (
define Step_6 as
(
[among ( (])
[substring] among (
'bb' (<-'b')
'cc' (<-'c')
'dd' (<-'d')
......@@ -177,7 +177,7 @@ backwardmode (
define Step_1c as
(
[among ( (] R1 C)
[substring] among ( (R1 C)
'd' (not ('n' R1) delete)
't' (not ('h' R1) delete)
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment