Changeset 5449 for trunk/indexers/mgpp


Ignore:
Timestamp:
2003-09-04T12:44:52+12:00 (21 years ago)
Author:
kjdon
Message:

added a new token type to the Lex module - UnknownE.
this will match any unrecognisable char - can now just skip over unknown chars rather than spitting the dummy and stopping the parsing

Location:
trunk/indexers/mgpp/text
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/indexers/mgpp/text/GSDLQueryLex.cpp

    r3365 r5449  
    224224
    225225  // assume it is a term of some sort
    226   if (!ParseTerm (here, end, el.text)) return false;
     226  if (!ParseTerm (here, end, el.text))  {
     227    // parse term returns false if it hasn't parsed anything that is a term
     228    // here should be the same as it was before
     229    el.lexType = UnknownE;
     230    AddNChar (here, el.text, charLen);
     231    return true;
     232  }
     233  //return false;
    227234
    228235  UCArray AND; SetCStr (AND, "AND");
  • trunk/indexers/mgpp/text/GSDLQueryLex.h

    r3365 r5449  
    2929enum LexType {NoTypeE, OpenBracketE, CloseBracketE, TermE, AndOpE, OrOpE,
    3030          NotOpE, NearOpE, QuoteE, IntegerE, TermWeightE, StemMethodE,
    31           RangeE, AtE, TagE, OpenSquareBracketE, CloseSquareBracketE};
     31          RangeE, AtE, TagE, OpenSquareBracketE, CloseSquareBracketE,
     32          UnknownE};
    3233
    3334struct LexEl {
  • trunk/indexers/mgpp/text/GSDLQueryParser.cpp

    r4210 r5449  
    247247      if (phrase) phrase=false;
    248248      else phrase=true;
     249    } else if (el.lexType == UnknownE) {
     250      // just ignore it
    249251    }
    250252    else {
     
    286288      break;
    287289     
     290    } else if (el.lexType == UnknownE) {
     291      // just ignore it
    288292    } else {
    289293      // error
     
    431435      curTree = NotAdd (curTree, newTerm);
    432436     
     437    } else if (el.lexType == UnknownE) {
     438      // just ignore it
    433439    } else {
    434440
Note: See TracChangeset for help on using the changeset viewer.