2017 © Pedro Peláez
 

library keywords

Automatic keywords out of given text

image

iankov/keywords

Automatic keywords out of given text

  • Tuesday, July 24, 2018
  • by iankov
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Usage

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

$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, (*2)

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

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

The Versions

24/07 2018

dev-master

9999999-dev

Automatic keywords out of given text

  Sources   Download

by Dmitriy Yankov

24/07 2018

v1.0.0

1.0.0.0

Automatic keywords out of given text

  Sources   Download

by Dmitriy Yankov