GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Text::Query::ParseAdvanced(3) User Contributed Perl Documentation Text::Query::ParseAdvanced(3)

Text::Query::ParseAdvanced - Parse AltaVista advanced query syntax

  use Text::Query;
  my $q=new Text::Query('hello and world',
                        -parse => 'Text::Query::ParseAdvanced',
                        -solve => 'Text::Query::SolveAdvancedString',
                        -build => 'Text::Query::BuildAdvancedString');

This module provides an object that parses a string containing a Boolean query expression similar to an AltaVista "advanced query".

It's base class is Text::Query::Parse;

Query expressions consist of literal strings (or regexps) joined by the following operators, in order of precedence from lowest to highest:

OR, |
AND, &
NEAR, ~
NOT, !

Operator names are not case-sensitive. Note that if you want to use a "|" in a regexp, you need to backwhack it to keep it from being seen as a query operator. Sub-expressions may be quoted in single or double quotes to match "and," "or," or "not" literally and may be grouped in parentheses ("(, )") to alter the precedence of evaluation.

A parenthesized sub-expression may also be concatenated with other sub- expressions to match sequences: "(Perl or Python) interpreter" would match either "Perl interpreter" or "Python interpreter". Concatenation has a precedence higher than NOT but lower than AND. Juxtaposition of simple words has the highest precedence of all.

These are the additional options of the "prepare" method and the constructor.
-near defaults to 10
Sets the number of words that can occur between two expressions and still satisfy the NEAR operator.
-operators defaults to and, or, not, near
Sets the operator names. The argument of the option is a pointer to a hash table mapping the default names to desired names. For instance:

    {
        'or' => 'ou',
        'and' => 'et',
        'near' => 'proche',
        'not' => 'non',
    }
    
-scope_map default to {}
Map the scope names to other names. If a scope is specified as "scope:" search the map for an entry whose key is "scope" and replace "scope" with the scalar found. For instance:

     {
         'scope' => 'otherscope'
     }
    

Text::Query(3) Text::Query::Parse(3)

Eric Bohlman (ebohlman@netcom.com)

Loic Dachary (loic@senga.org)

Jon Jensen, jon@endpoint.com

2022-04-08 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.