xiaobeicn / text-similarity-php

通过余弦定理+分词计算文本相似度PHP版
MIT License
110 stars 55 forks source link

Call to undefined function Home\Model\scws_new() #3

Closed LazyYangi closed 2 years ago

LazyYangi commented 2 years ago

Call to undefined function Home\Model\scws_new() private function segment($text) { $outText = array(); //实例化 $so = scws_new(); //字符集 $so->set_charset('utf8'); //处理 $so->send_text($text);

    //便利出需要的数组
    while ($res = $so->get_result()) {
        foreach ($res as $v) {
            $outText[] = isset($v['word']) ? strtoupper($v['word']) : "";
        }
    }
    //关闭
    $so->close();

    return $outText;
}
xiaobeicn commented 2 years ago

https://github.com/xiaobeicn/text-similarity-php/blob/master/TextSimilarity.class.php#L117