Convert negated words to unphrases, like we do with +d words to phrases
authorMike Rylander <mrylander@gmail.com>
Fri, 14 Sep 2012 18:28:20 +0000 (14:28 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Fri, 15 Feb 2013 20:39:46 +0000 (15:39 -0500)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/QueryParser.pm

index 0968a18..a5950af 100644 (file)
@@ -1165,10 +1165,10 @@ sub decompose {
 
             local $last_type = '';
 
-        } elsif (/^\s*$required_re([^${group_end}${float_end}\s"]+)/) { # phrase, always anded
+        } elsif (/^\s*($required_re|$disallowed_re)([^${group_end}${float_end}\s"]+)/) { # convert require/disallow word to {un}phrase
             warn '  'x$recursing."Encountered required atom (mini phrase), transforming for phrase parse: $1\n" if $self->debug;
 
-            $_ = '"' . $1 . '"' . $';
+            $_ = $1 . '"' . $2 . '"' . $';
 
             local $last_type = '';
         } elsif (/^\s*([^${group_end}${float_end}\s]+)/o) { # atom