Branch: Tag:

2008-06-25

2008-06-25 09:45:41 by Marcus Wellhardh <wellhard@roxen.com>

Improved last checkin slightly. If search phrase, remove empty globs. This might promote the search string to ordinary search word that do support tyhe remining globs.

Rev: lib/modules/Search.pmod/Grammar.pmod/DefaultParser.pike:1.13

1:   // This file is part of Roxen Search   // Copyright © 2001 Roxen IS. All rights reserved.   // - // $Id: DefaultParser.pike,v 1.12 2008/06/24 15:04:49 wellhard Exp $ + // $Id: DefaultParser.pike,v 1.13 2008/06/25 09:45:41 wellhard Exp $      static inherit .AbstractParser;   static inherit .Lexer;
333:    words[i]=replace(words[i], ({star, questionmark}), ({"*","?"}));    // End of abominable kludge    if (words) { +  // If search phrase, remove empty globs. This might promote to +  // ordinary search word that do support remining globs. +  if (sizeof(words) > 1) +  words = filter(words, lambda(string w) { return (w - "*" - "?") == "" ? 0 : 1; }); +     if (sizeof(words) == 1)    switch (prefix) {    case '+': node->plusWords += words; break;