Changeset 12313 for trunk/gsdl/src/mgpp/text
- Timestamp:
- 2006-07-28T11:38:35+12:00 (18 years ago)
- Location:
- trunk/gsdl/src/mgpp/text
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/mgpp/text/GSDLQueryParser.cpp
r9616 r12313 22 22 #include "GSDLQueryParser.h" 23 23 #include "GSDLQueryLex.h" 24 24 #include "words.h" 25 25 26 26 static QueryNode *ParseExpression (UCArray::const_iterator &here, … … 509 509 510 510 QueryNode *ParseQuery (const UCArray &queryStr, int defaultBoolCombine, 511 int defaultStemMethod) { 511 int defaultStemMethod, int maxnumeric) { 512 if (4 < maxnumeric < 512) { 513 MAXNUMERIC = maxnumeric; 514 } 512 515 UCArray::const_iterator here = queryStr.begin(); 513 516 UCArray::const_iterator end = queryStr.end(); -
trunk/gsdl/src/mgpp/text/GSDLQueryParser.h
r4209 r12313 35 35 // should be set using the values from the preferences page 36 36 QueryNode *ParseQuery (const UCArray &queryStr, int defaultBoolCombine, 37 int defaultStemMethod );37 int defaultStemMethod, int maxnumeric); 38 38 39 39 #endif -
trunk/gsdl/src/mgpp/text/Queryer.cpp
r12308 r12313 50 50 << "\t.c0/.c1\t\tcasefolding off/on\n" 51 51 << "\t.s0/.s1\t\tstemming off/on\n" 52 << "\t.o0/.o1\t\tshort output off/on\n\n" 52 << "\t.o0/.o1\t\tshort output off/on\n" 53 << "\t.m\t\tset maxnumeric (enter the number at the prompt)\n\n" 53 54 << "\t.p\t\tprint a document (enter the docnum at the prompt)\n" 54 55 << "otherwise just enter a query\n\n"; … … 101 102 } 102 103 104 int maxnumeric = 4; 105 103 106 // debug output 104 107 cerr << "num docs: "<<indexData.bdh.num_docs … … 167 170 } 168 171 169 172 else if (queryArray[1] == 'm') { 173 // maxnumeric 174 int m = 0; 175 cin >> m; 176 cin.getline(query, 2048, '\n'); // eat up return 177 if (4 < m < 512) { 178 maxnumeric = m; 179 } 180 } 170 181 else if (queryArray[1] == 'p') { 171 182 // print … … 239 250 else { 240 251 // regular query 241 queryTree = ParseQuery (queryArray, defaultBoolCombine, defaultStemMethod );252 queryTree = ParseQuery (queryArray, defaultBoolCombine, defaultStemMethod, maxnumeric); 242 253 if (queryTree == NULL) { 243 254 cout << "invalid syntax\n"; -
trunk/gsdl/src/mgpp/text/mgpp_passes.cpp
r9611 r12313 61 61 #include "TextEl.h" 62 62 #include "TagInfo.h" 63 63 #include "words.h" 64 64 #define MAX_PASSES 5 65 65 … … 99 99 " %s [-J doc-tag] [-K level-tag] [-L index-level]\n" 100 100 " %*s [-m invf-memory] [-T1] [-T2] [-I1] [-I2] [-S]\n" 101 " %*s [-C] [-h] [-d directory] -f name\n\n";101 " %*s [-C] [-h] [-d directory] [-M maxnumeric] -f name\n\n"; 102 102 103 103 … … 180 180 181 181 int main (int argc, char **argv) { 182 int ch, in_fd ;182 int ch, in_fd, maxnum; 183 183 char *filename = NULL; 184 184 bool compatMode = false; … … 189 189 190 190 opterr = 0; 191 while ((ch=getopt(argc, argv, "J:K:L: f:d:m:I:T:SCh"))!=-1){191 while ((ch=getopt(argc, argv, "J:K:L:M:f:d:m:I:T:SCh"))!=-1){ 192 192 switch (ch) { 193 193 case 'J': … … 199 199 case 'L': 200 200 tagInfo.SetIndexLevel (optarg); 201 break; 202 case 'M': 203 maxnum = atoi(optarg); 204 if (4 < maxnum < 512) { 205 cout << "setting maxnum to "<<maxnum<<endl; 206 MAXNUMERIC = maxnum; 207 } 201 208 break; 202 209 case 'f': -
trunk/gsdl/src/mgpp/text/words.cpp
r8691 r12313 27 27 #include "words.h" 28 28 29 int MAXNUMERIC = 4; 29 30 30 31 /* Takes the place of the old INAWORD macro. It determines -
trunk/gsdl/src/mgpp/text/words.h
r9611 r12313 19 19 * 20 20 **************************************************************************/ 21 #ifndef H_WORDS 22 #define H_WORDS 23 21 24 22 25 #include "sysfuncs.h" … … 50 53 of the program, , i.e., leave MAXSTEMLEN alone... */ 51 54 52 #define MAXNUMERIC 455 //#define MAXNUMERIC 4 53 56 /* Maximum number of numeric characters permitted in a word. 54 57 This avoids long sequences of numbers creating just one 55 58 word occurrence for each number. At most 10,000 all numeric 56 59 words will be permitted. */ 60 61 extern int MAXNUMERIC; 57 62 58 63 /* [RPAP - Jan 97: Stem Index Change] */ … … 163 168 *(Word) = length; \ 164 169 }while(0) 170 171 #endif
Note:
See TracChangeset
for help on using the changeset viewer.