定制 iankov/keywords 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

iankov/keywords

Composer 安装命令:

composer require iankov/keywords

包简介

Automatic keywords out of given text

README 文档

README

The package groups and counts similar words. The most used words in the text are used for building keywords $keywords->string($wordsCount, $delimiter)

$keywords = new Keywords;

$keywords->config([
    'min_keyword_length' => 3, //ignore words with length less then 3
    'min_keyword_similarity' => 80, //group similar words with similarity at least 80%
    'encoding' => 'utf-8' //text encoding
]);

$keywords->content($text_or_html); //set text or html which would be scanned for keywords

$keywords->content(); //get content

$keywords->ignore($string, $type); //ignore $string of $type(word, symbol, regex) from content
$keywords->ignoreWord('are'); //ignore word
$keywords->ignoreSymbol('@'); //ignore symbol
$keywords->ignoreRegex('/[0-9]+/i'); //ignore regex

$keywords->replace('/halo/i', 'hello'); //replace

$keywords->generate(); //generate keywords

$keywords->get(); //get Collection of keywords (not sorted)
$keywords->string(10, ' '); //get 10 most used keywords as a string separated by space

Also it is possible to use functions in a chain

$keywords = new Keywords;
$stringOfKeywords = $keywords->content($text_or_html)->generate()->string(20);

$collectionOfKeywords = (new Keywords)->content($text)->ignoreWord(['hello', 'world'])->generate()->get();

统计信息

  • 总下载量: 16
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2018-07-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固