Skip to content

malahierba-lab/word-counter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Word Counter

Laravel simple tool for word counting tasks. Powered by malahierba.cl dev team

Installation

Add in your composer.json:

{
    "require": {
        "malahierba-lab/word-counter": "0.*"
    }
}

Then you need run the composer update command.

Use

Important: For documentation purposes, in the examples below, always we assume than you import the library into your namespace using use Malahierba\WordCounter;

$wordcounter = new WordCounter;

// Load string to analize
$wordcounter->load('some text');

// Count all words
$total = $wordcounter->countTotalWords();

// Count each word
// You receive an array with objects:
// -> word
// -> count
$eachWord = $wordcounter->countEachWord();

//example to get info for each word
foreach ($eachWord as $item) {
    $word   = $item->word;
    $count  = $item->count;
}

Licence

This project has MIT licence. For more information please read LICENCE file.

About

Laravel simple tool for word counting tasks

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages