File: TermGenerator.java

package info (click to toggle)
xapian-bindings 1.4.31-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 21,456 kB
  • sloc: cpp: 379,927; python: 10,780; cs: 9,529; java: 6,949; sh: 5,017; perl: 4,435; makefile: 1,277; ruby: 1,028; php: 586; tcl: 246
file content (239 lines) | stat: -rw-r--r-- 8,126 bytes parent folder | download | duplicates (2)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (https://www.swig.org).
 * Version 4.3.0
 *
 * Do not make changes to this file unless you know what you are doing - modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package org.xapian;

public class TermGenerator {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

  protected TermGenerator(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected static long getCPtr(TermGenerator obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected static long swigRelease(TermGenerator obj) {
    long ptr = 0;
    if (obj != null) {
      if (!obj.swigCMemOwn)
        throw new RuntimeException("Cannot release ownership as memory is not owned");
      ptr = obj.swigCPtr;
      obj.swigCMemOwn = false;
      obj.delete();
    }
    return ptr;
  }

  @SuppressWarnings({"deprecation", "removal"})
  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        XapianJNI.delete_TermGenerator(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public TermGenerator() {
    this(XapianJNI.new_TermGenerator(), true);
  }

  public void setStemmer(Stem stemmer) {
    XapianJNI.TermGenerator_setStemmer(swigCPtr, this, Stem.getCPtr(stemmer), stemmer);
  }

  public void setStopper(Stopper stop) {
    XapianJNI.TermGenerator_setStopper__SWIG_0(swigCPtr, this, Stopper.getCPtr(stop), stop);
  }

  public void setStopper() {
    XapianJNI.TermGenerator_setStopper__SWIG_1(swigCPtr, this);
  }

  public void setDocument(Document doc) {
    XapianJNI.TermGenerator_setDocument(swigCPtr, this, Document.getCPtr(doc), doc);
  }

  public Document getDocument() {
    return new Document(XapianJNI.TermGenerator_getDocument(swigCPtr, this), false);
  }

  public void setDatabase(WritableDatabase db) {
    XapianJNI.TermGenerator_setDatabase(swigCPtr, this, WritableDatabase.getCPtr(db), db);
  }

  public int setFlags(int toggle, int mask) {
    return XapianJNI.TermGenerator_setFlags__SWIG_0(swigCPtr, this, toggle, mask);
  }

  public int setFlags(int toggle) {
    return XapianJNI.TermGenerator_setFlags__SWIG_1(swigCPtr, this, toggle);
  }

  public void setStemmingStrategy(TermGenerator.stem_strategy strategy) {
    XapianJNI.TermGenerator_setStemmingStrategy(swigCPtr, this, strategy.swigValue());
  }

  public void setStopperStrategy(TermGenerator.stop_strategy strategy) {
    XapianJNI.TermGenerator_setStopperStrategy(swigCPtr, this, strategy.swigValue());
  }

  public void setMaxWordLength(long max_word_length) {
    XapianJNI.TermGenerator_setMaxWordLength(swigCPtr, this, max_word_length);
  }

  public void indexText(String text, long wdf_inc, String prefix) {
    XapianJNI.TermGenerator_indexText__SWIG_0(swigCPtr, this, text, wdf_inc, prefix);
  }

  public void indexText(String text, long wdf_inc) {
    XapianJNI.TermGenerator_indexText__SWIG_1(swigCPtr, this, text, wdf_inc);
  }

  public void indexText(String text) {
    XapianJNI.TermGenerator_indexText__SWIG_2(swigCPtr, this, text);
  }

  public void indexTextWithoutPositions(String text, long wdf_inc, String prefix) {
    XapianJNI.TermGenerator_indexTextWithoutPositions__SWIG_0(swigCPtr, this, text, wdf_inc, prefix);
  }

  public void indexTextWithoutPositions(String text, long wdf_inc) {
    XapianJNI.TermGenerator_indexTextWithoutPositions__SWIG_1(swigCPtr, this, text, wdf_inc);
  }

  public void indexTextWithoutPositions(String text) {
    XapianJNI.TermGenerator_indexTextWithoutPositions__SWIG_2(swigCPtr, this, text);
  }

  public void increaseTermpos(long delta) {
    XapianJNI.TermGenerator_increaseTermpos__SWIG_0(swigCPtr, this, delta);
  }

  public void increaseTermpos() {
    XapianJNI.TermGenerator_increaseTermpos__SWIG_1(swigCPtr, this);
  }

  public long getTermPos() {
    return XapianJNI.TermGenerator_getTermPos(swigCPtr, this);
  }

  public void setTermpos(long termpos) {
    XapianJNI.TermGenerator_setTermpos(swigCPtr, this, termpos);
  }

  public String toString() {
    return XapianJNI.TermGenerator_toString(swigCPtr, this);
  }

  public final static int FLAG_SPELLING = XapianJNI.TermGenerator_FLAG_SPELLING_get();
  public final static int FLAG_NGRAMS = XapianJNI.TermGenerator_FLAG_NGRAMS_get();
  public final static int FLAG_CJK_NGRAM = XapianJNI.TermGenerator_FLAG_CJK_NGRAM_get();

  public final static class stem_strategy {
    public final static TermGenerator.stem_strategy STEM_NONE = new TermGenerator.stem_strategy("STEM_NONE");
    public final static TermGenerator.stem_strategy STEM_SOME = new TermGenerator.stem_strategy("STEM_SOME");
    public final static TermGenerator.stem_strategy STEM_ALL = new TermGenerator.stem_strategy("STEM_ALL");
    public final static TermGenerator.stem_strategy STEM_ALL_Z = new TermGenerator.stem_strategy("STEM_ALL_Z");
    public final static TermGenerator.stem_strategy STEM_SOME_FULL_POS = new TermGenerator.stem_strategy("STEM_SOME_FULL_POS");

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static stem_strategy swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + stem_strategy.class + " with value " + swigValue);
    }

    private stem_strategy(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private stem_strategy(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private stem_strategy(String swigName, stem_strategy swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static stem_strategy[] swigValues = { STEM_NONE, STEM_SOME, STEM_ALL, STEM_ALL_Z, STEM_SOME_FULL_POS };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

  public final static class stop_strategy {
    public final static TermGenerator.stop_strategy STOP_NONE = new TermGenerator.stop_strategy("STOP_NONE");
    public final static TermGenerator.stop_strategy STOP_ALL = new TermGenerator.stop_strategy("STOP_ALL");
    public final static TermGenerator.stop_strategy STOP_STEMMED = new TermGenerator.stop_strategy("STOP_STEMMED");

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static stop_strategy swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + stop_strategy.class + " with value " + swigValue);
    }

    private stop_strategy(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private stop_strategy(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private stop_strategy(String swigName, stop_strategy swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static stop_strategy[] swigValues = { STOP_NONE, STOP_ALL, STOP_STEMMED };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

}