PHP 클래스 cebe\jssearch\tokenizer\StandardTokenizer

저자: Carsten Brandt ([email protected])
상속: implements cebe\jssearch\TokenizerInterface
파일 보기 프로젝트 열기: cebe/js-search

공개 프로퍼티들

프로퍼티 타입 설명
$delimiters a list of characters that should be used as word delimiters.
$stopWords a list of stopwords to remove from the token list.

공개 메소드들

메소드 설명
tokenize ( string $string ) : array Tokenizes a string and returns an array of the following format:
tokenizeJs ( ) : string Returns a javascript equivalent of [[tokenize]] that will be used on client side to tokenize the search query.

메소드 상세

tokenize() 공개 메소드

[['t' => 'word', 'w' => 2], ['t' => 'other', 'w' => 1]] where the first part is the token string and the second is a weight value. Also removes [[stopWords]] from the list.
public tokenize ( string $string ) : array
$string string the string to tokenize
리턴 array

tokenizeJs() 공개 메소드

This is used to ensure the same tokenizer is used for building the index and for searching.
public tokenizeJs ( ) : string
리턴 string

프로퍼티 상세

$delimiters 공개적으로 프로퍼티

a list of characters that should be used as word delimiters.
public $delimiters

$stopWords 공개적으로 프로퍼티

a list of stopwords to remove from the token list.
public $stopWords