...汇数组, 每个词汇是包含 [off:词在文本中的位置,attr:词性,word:词] 源码: sdk/php/lib/XSTokenizer.class.php#L339 (显示) public function getResult($text){ $words = array(); $text = $this->applySetting($text); $cmd = new XSCommand(XS_CMD_SEARCH_SCWS_GET, XS_CMD_SCWS_...
...rray 返回词汇数组, 每个词汇是包含 [times:次数,attr:词性,word:词] 源码: sdk/php/lib/XSTokenizer.class.php#L361 (显示) public function getTops($text, $limit = 10, $xattr = ''){ $words = array(); $text = $this->applySetting($text); $cmd = new XSCommand(XS_CMD_SEARC...
...se UTF-8 $_charset = self::$_charset; self::$_charset = 'UTF-8'; $words = $this->getResult($value); foreach ($words as $word) { $tokens[] = $word['word']; } // restore charset self::$_charset = $_charset; return $tokens;} XSTokenizer 接口
...izerScws getVersion() 获取 scws 版本号 XSTokenizerScws hasWord() 判断是否包含指定词性的词 XSTokenizerScws setCharset() 设置字符集 XSTokenizerScws setDict() 设置分词词典, 支持 TXT/XDB 格式 XSTokenizerScws setDuality() 设置散字...
hasWord() 方法 public bool hasWord(string $text, string $xattr) $text string 要判断的文本 $xattr string 要判断的词性, 参见 getTops 的说明 {return} bool 文本中是否包含指定词性的词汇 源码: sdk/php/lib/XSTokenizer.class.php#L382 (显...