1
1
/*************************************************************************************************
2
2
* Pure Java interface of Hyper Estraier
3
* Copyright (C) 2004-2005 Mikio Hirabayashi
3
* Copyright (C) 2004-2006 Mikio Hirabayashi
4
4
* All rights reserved.
5
5
* This file is part of Hyper Estraier.
6
6
* Redistribution and use in source and binary forms, with or without modification, are
43
43
// public constants
44
44
//----------------------------------------------------------------
45
45
/** option: check every N-gram key */
46
public static int SURE = 1 << 0;
46
public static final int SURE = 1 << 0;
47
47
/** option: check N-gram keys skipping by one */
48
public static int USUAL = 1 << 1;
48
public static final int USUAL = 1 << 1;
49
49
/** option: check N-gram keys skipping by two */
50
public static int FAST = 1 << 2;
50
public static final int FAST = 1 << 2;
51
51
/** option: check N-gram keys skipping by three */
52
public static int AGITO = 1 << 3;
52
public static final int AGITO = 1 << 3;
53
53
/** option: without TF-IDF tuning */
54
public static int NOIDF = 1 << 4;
54
public static final int NOIDF = 1 << 4;
55
55
/** option: with the simplified phrase */
56
public static int SIMPLE = 1 << 10;
57
/** option: attach keywords */
58
public static int ETCH = 1 << 20;
56
public static final int SIMPLE = 1 << 10;
57
/** option: with the rough phrase */
58
public static final int ROUGH = 1 << 11;
59
/** option: with the union phrase */
60
public static final int UNION = 1 << 15;
61
/** option: with the intersection phrase */
62
public static final int ISECT = 1 << 16;
59
63
//----------------------------------------------------------------
61
65
//----------------------------------------------------------------
108
121
public void set_max(int max){
122
if(max >= 0) this.max = max;
125
* Set the number of skipped documents.
126
* @param skip the number of documents to be skipped in the search result.
128
public void set_skip(int skip){
129
if(skip >= 0) this.skip = skip;
112
132
* Set options of retrieval.
114
134
* `Condition.USUAL', which is the default, specifies that it checks N-gram keys with skipping
115
135
* one key, `Condition.FAST' skips two keys, `Condition.AGITO' skips three keys,
116
136
* `Condition.NOIDF' specifies not to perform TF-IDF tuning, `Condition.SIMPLE' specifies to
117
* use simplified phrase. `Condition.ETCH' specifies to attach the keyword vector. Each
137
* use simplified phrase, `Condition.ROUGH' specifies to use rough phrase, `Condition.UNION'
138
* specifies to use union phrase, `Condition.ISECT' specifies to use intersection phrase. Each
118
139
* option can be specified at the same time by bitwise or. If keys are skipped, though search
119
140
* speed is improved, the relevance ratio grows less.
121
142
public void set_options(int options){
122
143
this.options |= options;
146
* Set permission to adopt result of the auxiliary index.
147
* @param min the minimum hits to adopt result of the auxiliary index. If it is not more
148
* than 0, the auxiliary index is not used. By default, it is 32.
150
public void set_auxiliary(int min){
151
this.auxiliary = min;
154
* Set the attribute distinction filter.
155
* @param name the name of an attribute to be distinct.
157
public void set_distinct(String name){
161
* Set the mask of targets of meta search.
162
* @param mask a masking number. 1 means the first target, 2 means the second target, 4 means
163
* the third target and, power values of 2 and their summation compose the mask.
165
public void set_mask(int mask){
166
this.mask = mask & 0x7fffffff;
124
168
//----------------------------------------------------------------
125
169
// package methods
126
170
//----------------------------------------------------------------
202
* Get the number of skipped documents.
203
* @return the number of documents to be skipped in the search result.
158
209
* Get options of retrieval.
159
210
* @return options by bitwise or.
216
* Get permission to adopt result of the auxiliary index.
217
* @return permission to adopt result of the auxiliary index.
223
* Get the attribute distinction filter.
224
* @return the name of the distinct attribute.
227
if(distinct == null) return "";
231
* Get the mask of targets of meta search.
232
* @return the mask of targets of meta search.