... 编写自定义分词器 -------------- 自定义分词器必须实现 [XSTokenizer] 接口。假定您要编写一个名为 `xyz` 的分词器,则您要编写的代码 文件为 `XSTokenizerXyz.class.php`,请将文件统一放入 `$prefix/sdk/php/lib` 目录。 通常来讲,您只需要...
... 解析字段对象属性 getCustomTokenizer() 方法 public XSTokenizer getCustomTokenizer() {return} XSTokenizer 获取当前字段的自定义词法分析器 源码: sdk/php/lib/XSFieldScheme.class.php#L414 (显示) public function getCustomTokenizer(){ if (isset(sel...
...$value, $doc=NULL) $value $doc 源码: sdk/php/lib/XSTokenizer.class.php#L220 (显示) public function getTokens($value, XSDocument $doc = null){ $tokens = array(); $this->setIgnore(true); // save charset, force to use UTF-8 $_charset = self::$_charset; self::...
... public void __construct($arg=NULL) $arg 源码: sdk/php/lib/XSTokenizer.class.php#L106 (显示) public function __construct($arg = null){ if ($arg !== null && $arg !== '') { $this->arg = intval($arg); if ($this->arg < 1 || $this->arg > 255) { throw new XSE...
... public void __construct($arg=NULL) $arg 源码: sdk/php/lib/XSTokenizer.class.php#L137 (显示) public function __construct($arg = null){ if ($arg !== null && $arg !== '') { $this->arg = intval($arg); if ($this->arg < 1 || $this->arg > 255) { throw new XSE...
...) public function hasCustomTokenizer(){ return ($this->tokenizer !== XSTokenizer::DFL);} 判断当前字段是否采用自定义分词器
getTokens() 方法 public void getTokens($value, $doc=NULL) $value $doc 源码: sdk/php/lib/XSTokenizer.class.php#L62 (显示) public function getTokens($value, XSDocument $doc = null){ return array($value);}
getTokens() 方法 public void getTokens($value, $doc=NULL) $value $doc 源码: sdk/php/lib/XSTokenizer.class.php#L46 (显示) public function getTokens($value, XSDocument $doc = null){ return array();}
__construct() 方法 public void __construct($arg=NULL) $arg 源码: sdk/php/lib/XSTokenizer.class.php#L79 (显示) public function __construct($arg = null){ if ($arg !== null && $arg !== '') { $this->arg = $arg; }}
...$value, $doc=NULL) $value $doc 源码: sdk/php/lib/XSTokenizer.class.php#L116 (显示) public function getTokens($value, XSDocument $doc = null){ $terms = array(); for ($i = 0; $i < strlen($value); $i += $this->arg) { $terms[] = substr($value, $i, $this->arg); ...