WPDev.one
Core Class

WP_Token_Map

class WP_Token_Map // Constructor: function Object() { [native code] }

WP_Token_Map class.

Methods 8 methods

Method / Return Description
from_array()
(WP_Token_Map

Create a token map using an associative array of key/value pairs as the input.

Parameters: $mappings: array, $key_length: int
from_precomputed_table()
WP_Token_Map

Creates a token map from a pre-computed table.

Parameters: $state: mixed
contains()
bool

Indicates if a given word is a lookup key in the map.

Parameters: $word: string, $case_sensitivity: string
read_token()
(string

If the text starting at a given offset is a lookup key in the map,

Parameters: $text: string, $offset: int, $matched_token_byte_length: mixed, $case_sensitivity: mixed
read_small_token()
(string

Finds a match for a short word at the index.

Parameters: $text: string, $offset: int, $matched_token_byte_length: mixed, $case_sensitivity: mixed
to_array()
array

Exports the token map into an associate array of key/value pairs.

precomputed_php_source_table()
string

Export the token map for quick loading in PHP source code.

Parameters: $indent: string
longest_first_then_alphabetical()
int

Compares two strings, returning the longest, or whichever

Parameters: $a: string, $b: string

Properties

Property / Type Description
$key_length
mixed
public
No description available.
$large_words
mixed
public
No description available.
$groups
mixed
public
No description available.
$small_words
mixed
public
No description available.
$small_mappings
mixed
public
No description available.

Class Information

Since Version
6.6.0
Source File
wp-includes/class-wp-token-map.php
Advertisement