包 | XS.tokenizer |
---|---|
继承关系 | class XSTokenizerXstep |
实现接口 | XSTokenizer |
版本 | 1.0.0 |
源代码 | sdk/php/lib/XSTokenizer.class.php |
public void __construct($arg=NULL)
| ||
$arg |
public function __construct($arg = null)
{
if ($arg !== null && $arg !== '') {
$this->arg = intval($arg);
if ($this->arg < 1 || $this->arg > 255) {
throw new XSException('Invalid argument for ' . __CLASS__ . ': ' . $arg);
}
}
}
public void getTokens($value, $doc=NULL)
| ||
$value | ||
$doc |
public function getTokens($value, XSDocument $doc = null)
{
$terms = array();
$i = $this->arg;
while (true) {
$terms[] = substr($value, 0, $i);
if ($i >= strlen($value)) {
break;
}
$i += $this->arg;
}
return $terms;
}
包 | XS.tokenizer |
---|---|
继承关系 | class XSTokenizerXstep |
实现接口 | XSTokenizer |
版本 | 1.0.0 |
源代码 | sdk/php/lib/XSTokenizer.class.php |
public void __construct($arg=NULL)
| ||
$arg |
public function __construct($arg = null)
{
if ($arg !== null && $arg !== '') {
$this->arg = intval($arg);
if ($this->arg < 1 || $this->arg > 255) {
throw new XSException('Invalid argument for ' . __CLASS__ . ': ' . $arg);
}
}
}
public void getTokens($value, $doc=NULL)
| ||
$value | ||
$doc |
public function getTokens($value, XSDocument $doc = null)
{
$terms = array();
$i = $this->arg;
while (true) {
$terms[] = substr($value, 0, $i);
if ($i >= strlen($value)) {
break;
}
$i += $this->arg;
}
return $terms;
}
留下一条评论吧!
请到论坛 登录 后刷新本页面!