Пример #1
0
 /**
  * 附加词语测试
  */
 public function testAddonSimple()
 {
     echo "test attach ... \n";
     $split = new Split();
     $split->attach(['康师傅手机']);
     var_dump($split->simple("您好phpSplit,你喜欢康师傅手机么?"));
     $this->assertTrue(True);
 }
Пример #2
0
 public static function start($string)
 {
     // TODO 分词+原句
     $split = new Split();
     $strings = $split->start($string);
     self::filter($strings);
     // abc
     // a
     // a - b
     // a - b - c
     $strings[] = $string;
     // TODO 过滤
     return self::generate($strings);
 }