Semantic MediaWiki and related extensions
Public Member Functions | List of all members
SMW\Query\Parser\Tokenizer Class Reference

Public Member Functions

 setDefaultPattern (array $prefixes)
 
 getToken (&$currentString, $stoppattern='', $consume=true, $trim=true)
 

Detailed Description

GNU GPL v2+

Since
3.0
Author
Markus Krötzsch

Member Function Documentation

◆ getToken()

SMW\Query\Parser\Tokenizer::getToken ( $currentString,
  $stoppattern = '',
  $consume = true,
  $trim = true 
)

Get the next unstructured string chunk from the query string. Chunks are delimited by any of the special strings used in inline queries (such as [[, ]], <q>, ...). If the string starts with such a delimiter, this delimiter is returned. Otherwise the first string in front of such a delimiter is returned. Trailing and initial spaces are ignored if $trim is true, and chunks consisting only of spaces are not returned. If there is no more qurey string left to process, the empty string is returned (and in no other case).

The stoppattern can be used to customise the matching, especially in order to overread certain special symbols.

$consume specifies whether the returned chunk should be removed from the query string.

Parameters
string$currentString
string$stoppattern
boolean$consume
boolean$trim
Returns
string

◆ setDefaultPattern()

SMW\Query\Parser\Tokenizer::setDefaultPattern ( array  $prefixes)
Since
3.0
Parameters
array$prefixes

The documentation for this class was generated from the following file:

About | General disclaimer | Privacy policy