1 Star 0 Fork 2

no2key/scws4

forked from xinghuo/scws4 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
CpscwsComponent.php 781 Bytes
一键复制 编辑 原始数据 按行查看 历史
xinghuo 提交于 2013-12-23 17:45 . init
<?php
class CpscwsComponent extends CApplicationComponent{
protected $cws;
public $test;
public $charset = 'gbk';
function init(){
parent::init();
require 'pscws4.class.php';
$pscwsPath = dirname(__FILE__);
$this->cws = new PSCWS4();
$this->cws->set_charset('utf8');
$this->cws->set_dict($pscwsPath . '/etc/dict.utf8.xdb');
$this->cws->set_rule($pscwsPath . '/etc/rules.utf8.ini');
//$this->cws->set_multi(3);
//$cws->set_ignore(true);
//$cws->set_duality(true);
}
function getWord($text){
$this->cws->send_text($text);
$words = array();
while ($tmp = $this->cws->get_result()){
foreach($tmp as $word){
$words[] = $word['word'] ;
}
}
return $words;
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/no2key/scws4.git
[email protected]:no2key/scws4.git
no2key
scws4
scws4
master

搜索帮助