Ignore:
Timestamp:
2001-01-22T14:53:42+13:00 (23 years ago)
Author:
kjm18
Message:

more options added

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/mgpp/text/Queryer.cpp

    r1769 r1849  
    9898  //SetCStr(level, "");
    9999   
    100   int defaultStemMethod = 1; // casefolded, unstemmed
     100  int defaultStemMethod = 0; // uncasefolded, unstemmed
    101101  int defaultBoolCombine = 0; // OR
     102  bool shortOutput = false;
    102103  BrowseQueryNode browseNode;
    103104  browseNode.startPosition = -10;
     
    160161    }
    161162      }
     163      else if (queryArray[1] == 'c') { // casefolding - on/off
     164    if (queryArray[2] == '1') defaultStemMethod |= 1;
     165    else if (queryArray[2] == '0') defaultStemMethod &= 0xe;
     166    else {
     167      cout << "Error: please enter .c0 (case sensitive) or .c1 (casefolded)\n";
     168    }
     169      }
     170      else if (queryArray[1] == 's') { // stemming - on/off
     171    if (queryArray[2] == '1') defaultStemMethod |=2;
     172    else if (queryArray[2] == '0') defaultStemMethod &=0xd;
     173    else {
     174      cout << "Error: please enter .s0 (unstemmed) or .s1 (stemmed)\n";
     175    }
     176      }     
     177      else if (queryArray[1] == 'o') { // output - short/long
     178    if (queryArray[2] == '1') shortOutput = true;
     179    else if (queryArray[2] == '0') shortOutput = false;
     180    else {
     181      cout << "Error: please enter .o0 (long output) or .o1 (short output)\n";
     182    }
     183      }
    162184      else if (queryArray[1] == 'b') {
    163185    // full text browse
     
    185207
    186208      MGQuery (indexData, queryInfo, queryTree, queryResult, level);
    187       cout << queryResult;
    188       cout << "\n";
    189      
     209      if (shortOutput) {
     210    queryResult.printShort(cout);
     211    cout << "\n";
     212      }else {
     213    cout << queryResult;
     214    cout << "\n";
     215      }
    190216      // delete the query
    191217      if (queryTree != NULL) delete queryTree;
Note: See TracChangeset for help on using the changeset viewer.