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


Manual Reference Pages  -  TEXT::QUERY::PARSESIMPLE (3)

.ds Aq ’

NAME

Text::Query::ParseSimple - Parse AltaVista simple query syntax

CONTENTS

SYNOPSIS



  use Text::Query;
  my $q=new Text::Query(hello and world,
                        -parse => Text::Query::ParseSimple,
                        -solve => Text::Query::SolveSimpleString,
                        -build => Text::Query::BuildSimpleString);



DESCRIPTION

This module provides an object that parses a string containing a Boolean query expression similar to an AltaVista simple query. Elements of the query expression may be assigned weights.

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

Query expressions are compiled into an internal form when a new object is created or the prepare method is called; they are not recompiled on each match.

Query expressions consist of words (sequences of non-whitespace) or phrases (quoted strings) separated by whitespace. Words or phrases prefixed with a + must be present for the expression to match; words or phrases prefixed with a - must be absent for the expression to match.

Words or phrases may optionally be followed by a number in parentheses (no whitespace is allowed between the word or phrase and the parenthesized number). This number specifies the weight given to the word or phrase. If a weight is not given, a weight of 1 is assumed.

EXAMPLES



  use Text::Query;
  my $q=new Text::Query(+hello world,
                        -solve => Text::Query::SolveSimpleString,
                        -build => Text::Query::BuildSimpleString);
  die "bad query expression" if not defined $q;
  $count=$q->match;
  ...
  $q->prepare(goodbye adios -"ta ta", -litspace=>1);
  #requires single space between the two tas
  if ($q->match($line, -case=>1)) {
  #doesnt match "Goodbye"
  ...
  $q->prepare(\\bintegrate\\b, -regexp=>1);
  #wont match "disintegrated"
  ...
  $q->prepare(information(2) retrieval);
  #information has twice the weight of retrieval



SEE ALSO

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

AUTHORS

Eric Bohlman (ebohlman@netcom.com)

Loic Dachary (loic@senga.org)

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


perl v5.20.3 TEXT::QUERY::PARSESIMPLE (3) 2013-08-13

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