PHP code example of zunyunkeji / wordparser

1. Go to this page and download the library: Download zunyunkeji/wordparser library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

zunyunkeji / wordparser example snippets


	$splitword = new \zunyunkeji\wordparser\splits();
	
	//分词
	print_r($splitword->get($content,$title));
	
	//分词快捷方法
	print_r(splits_get($content,$title));
	
	//获取排列前几位分词
	print_r($splitword->get($content,$title));
	
	//分词快捷方法
	print_r(splits_top($content,$title,5));

	$splitword->add("眉县猕猴桃");

	#添加分词到自定义分词文件
	$splitword->add("眉县猕猴桃", __DIR__.'/src/dict/other.dict');