.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Text::Query::ParseAdvanced 3" .TH Text::Query::ParseAdvanced 3 "2020-07-07" "perl v5.32.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Text::Query::ParseAdvanced \- Parse AltaVista advanced query syntax .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 5 \& use Text::Query; \& my $q=new Text::Query(\*(Aqhello and world\*(Aq, \& \-parse => \*(AqText::Query::ParseAdvanced\*(Aq, \& \-solve => \*(AqText::Query::SolveAdvancedString\*(Aq, \& \-build => \*(AqText::Query::BuildAdvancedString\*(Aq); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module provides an object that parses a string containing a Boolean query expression similar to an AltaVista \*(L"advanced query\*(R". .PP It's base class is Text::Query::Parse; .PP Query expressions consist of literal strings (or regexps) joined by the following operators, in order of precedence from lowest to highest: .IP "\s-1OR,\s0 |" 4 .IX Item "OR, |" .PD 0 .IP "\s-1AND, &\s0" 4 .IX Item "AND, &" .IP "\s-1NEAR,\s0 ~" 4 .IX Item "NEAR, ~" .IP "\s-1NOT,\s0 !" 4 .IX Item "NOT, !" .PD .PP Operator names are not case-sensitive. Note that if you want to use a \f(CW\*(C`|\*(C'\fR 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 \*(L"and,\*(R" \*(L"or,\*(R" or \*(L"not\*(R" literally and may be grouped in parentheses (\f(CW\*(C`(, )\*(C'\fR) to alter the precedence of evaluation. .PP A parenthesized sub-expression may also be concatenated with other sub\- expressions to match sequences: \f(CW\*(C`(Perl or Python) interpreter\*(C'\fR would match either \*(L"Perl interpreter\*(R" or \*(L"Python interpreter\*(R". Concatenation has a precedence higher than \s-1NOT\s0 but lower than \s-1AND.\s0 Juxtaposition of simple words has the highest precedence of all. .SH "OPTIONS" .IX Header "OPTIONS" These are the additional options of the \f(CW\*(C`prepare\*(C'\fR method and the constructor. .IP "\-near defaults to 10" 4 .IX Item "-near defaults to 10" Sets the number of words that can occur between two expressions and still satisfy the \s-1NEAR\s0 operator. .IP "\-operators defaults to and, or, not, near" 4 .IX Item "-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: .Sp .Vb 6 \& { \& \*(Aqor\*(Aq => \*(Aqou\*(Aq, \& \*(Aqand\*(Aq => \*(Aqet\*(Aq, \& \*(Aqnear\*(Aq => \*(Aqproche\*(Aq, \& \*(Aqnot\*(Aq => \*(Aqnon\*(Aq, \& } .Ve .IP "\-scope_map default to {}" 4 .IX Item "-scope_map default to {}" Map the scope names to other names. If a scope is specified as \f(CW\*(C`scope:\*(C'\fR search the map for an entry whose key is \f(CW\*(C`scope\*(C'\fR and replace \f(CW\*(C`scope\*(C'\fR with the scalar found. For instance: .Sp .Vb 3 \& { \& \*(Aqscope\*(Aq => \*(Aqotherscope\*(Aq \& } .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBText::Query\fR\|(3) \&\fBText::Query::Parse\fR\|(3) .SH "AUTHORS" .IX Header "AUTHORS" Eric Bohlman (ebohlman@netcom.com) .PP Loic Dachary (loic@senga.org) .PP Jon Jensen, jon@endpoint.com