Xunsearch PHP-SDK v1.3.2 API 参考文档

XSTokenizerXlen

XS.tokenizer
继承关系 class XSTokenizerXlen
实现接口 XSTokenizer
版本 1.0.0
源代码 sdk/php/lib/XSTokenizer.class.php
内置的定长分词器

Public 方法

隐去继承来的方法

名称描述定义于
__construct() XSTokenizerXlen
getTokens() XSTokenizerXlen

方法明细

__construct() 方法
public void __construct($arg=NULL)
$arg
源码: sdk/php/lib/XSTokenizer.class.php#L104 (显示)
public function __construct($arg null)
{
    if (
$arg !== null && $arg !== '')
    {
        
$this->arg intval($arg);
        if (
$this->arg || $this->arg 255)
            throw new 
XSException('Invalid argument for ' __CLASS__ ': ' $arg);
    }
}

getTokens() 方法
public void getTokens($value, $doc=NULL)
$value
$doc
源码: sdk/php/lib/XSTokenizer.class.php#L114 (显示)
public function getTokens($valueXSDocument $doc null)
{
    
$terms = array();
    for (
$i 0$i strlen($value); $i += $this->arg)
    {
        
$terms[] = substr($value$i$this->arg);
    }
    return 
$terms;
}

Copyright © 2008-2011 by 杭州云圣网络科技有限公司
All Rights Reserved.