Search/Lucene/Search/QueryLexer.php

Show: PublicProtectedPrivateinherited
Table of Contents
Zend Framework
LICENSE This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to [email protected] so we can send you a copy immediately.
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Search_Lucene  
Subpackage
Search  
Version
$Id$  

\Zend_Search_Lucene_Search_QueryLexer

Package: Zend_Search_Lucene\Search
Abstract Finite State Machine
Take a look on Wikipedia state machine description: http://en.wikipedia.org/wiki/Finite_state_machine Any type of Transducers (Moore machine or Mealy machine) also may be implemented by using this abstract FSM. process() methods invokes a specified actions which may construct FSM output. Actions may be also used to signal, that we have reached Accept State
Parent(s)
\Zend_Search_Lucene_FSM
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

>VConstant  ST_WHITE_SPACE = 0
State Machine states
>VConstant  ST_SYNT_LEXEME = 1
>VConstant  ST_LEXEME = 2
>VConstant  ST_QUOTED_LEXEME = 3
>VConstant  ST_ESCAPED_CHAR = 4
>VConstant  ST_ESCAPED_QCHAR = 5
>VConstant  ST_LEXEME_MODIFIER = 6
>VConstant  ST_NUMBER = 7
>VConstant  ST_MANTISSA = 8
>VConstant  ST_ERROR = 9
>VConstant  IN_WHITE_SPACE = 0
Input symbols
>VConstant  IN_SYNT_CHAR = 1
>VConstant  IN_LEXEME_MODIFIER = 2
>VConstant  IN_ESCAPE_CHAR = 3
>VConstant  IN_QUOTE = 4
>VConstant  IN_DECIMAL_POINT = 5
>VConstant  IN_ASCII_DIGIT = 6
>VConstant  IN_CHAR = 7
>VConstant  IN_MUTABLE_CHAR = 8
>VConstant  QUERY_WHITE_SPACE_CHARS = " \n\r\t"
>VConstant  QUERY_SYNT_CHARS = ':()[]{}!|&'
>VConstant  QUERY_MUTABLE_CHARS = '+-'
>VConstant  QUERY_DOUBLECHARLEXEME_CHARS = '|&'
>VConstant  QUERY_LEXEMEMODIFIER_CHARS = '~^'
>VConstant  QUERY_ASCIIDIGITS_CHARS = '0123456789'

Properties

>VPropertyprivatestring $_currentLexeme
Recognized part of current lexeme
Details
Type
string
>VPropertyprivatearray $_lexemes
List of recognized lexemes
Details
Type
array
>VPropertyprivatearray $_queryString
Query string (array of single- or non single-byte characters)
Details
Type
array
>VPropertyprivateinteger $_queryStringPosition
Current position within a query string Used to create appropriate error messages
Details
Type
integer

Methods

methodpublic__construct() : void

methodprivate_positionMsg() : string

Position message

Returns
TypeDescription
string
methodprivate_translateInput(string $char) : integer

Translate input char to an input symbol of state machine

Parameters
NameTypeDescription
$charstring
Returns
TypeDescription
integer
methodpublicaddLexeme() : void

Add lexeme

methodpublicaddLexemeChar() : void

Extend lexeme by one char

methodpublicaddLexemeModifier() : void

Add lexeme modifier

methodpublicaddNumberLexeme() : void

Add number lexeme

methodpublicaddQuerySyntaxLexeme() : void

Add query syntax lexeme

methodpublicaddQuotedLexeme() : void

Add quoted lexeme

methodpubliclexModifierErrException() : void

methodpublicquoteWithinLexemeErrException() : void

methodpublictokenize(string $inputString, string $encoding) : array

This method is used to tokenize query string into lexemes

Parameters
NameTypeDescription
$inputStringstring
$encodingstring
Returns
TypeDescription
array
Throws
ExceptionDescription
\Zend_Search_Lucene_Search_QueryParserException
methodpublicwrongNumberErrException() : void

Documentation was generated by phpDocumentor 2.2.0 .