Ignore:
Timestamp:
2002-06-21T14:45:03+12:00 (20 years ago)
Author:
kjdon
Message:

syntax now handles phrases insode a field search, and term modifiers(#is)
inside a phrase.

File:
1 edited

Legend:

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

    r2692 r3161  
    223223
    224224  LexEl el;
     225  bool phrase=false;
     226  bool first=true;
    225227  while (ParseLexEl (here, end, el)) {
    226228    if (el.lexType == TermE || el.lexType == IntegerE) {
     
    228230      termNode.term = el.text;
    229231      ParseTermModifiers (here, end, termNode, defaultStemMethod);
     232      if (phrase) {
     233        if (first) first=false;
     234        else {
     235          termNode.startRange = -2;
     236          termNode.endRange = -1;
     237        }
     238      } 
    230239      proxNode->terms.push_back(termNode);
    231240    }
     
    239248    else if (el.lexType == OrOpE) {
    240249      cerr << "or inside []\n";
     250    }
     251    else if (el.lexType == QuoteE) {
     252      // phrase inside square brackets
     253      if (phrase) phrase=false;
     254      else phrase=true;
    241255    }
    242256    else {
     
    262276      TermNode termNode;
    263277      termNode.term = el.text;
    264       termNode.stemMethod = defaultStemMethod;
    265       //ParseTermModifiers (here, end, termNode, defaultStemMethod);
     278      //termNode.stemMethod = defaultStemMethod;
     279      ParseTermModifiers (here, end, termNode, defaultStemMethod);
    266280      if (first) {
    267281    first = false;
Note: See TracChangeset for help on using the changeset viewer.