summaryrefslogtreecommitdiffstats
path: root/web/server/h2o/libh2o/misc/oktavia/src/stemmer/among.jsx
blob: f695b94beef1c160c32caf06795e83d0dd79ca76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import "base-stemmer.jsx";

class Among
{
    var s_size : int;           /* search string */
    var s : string;             /* search string */
    var substring_i : int;      /* index to longest matching substring */
    var result : int;           /* result of the lookup */
    var instance : Nullable.<BaseStemmer> ;
                                /* object to invoke method on. It is a BaseStemmer */
    var method : Nullable.<(BaseStemmer) -> boolean>;
                                /* method to use if substring matches */

    function constructor (s : string, substring_i : int, result : int)
    {
        this.s_size = s.length;
        this.s = s;
        this.substring_i = substring_i;
	this.result = result;
        this.method = null;
	this.instance = null;
    }

    function constructor (s : string, substring_i : int, result : int,
                          method : (BaseStemmer) -> boolean, instance : BaseStemmer)
    {
        this.s_size = s.length;
        this.s = s;
        this.substring_i = substring_i;
	this.result = result;
        this.method = method;
	this.instance = instance;
    }
}