malahierba-lab/word-counter

Laravel simple tool for word counting tasks

Installs: 1 239

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 1

Forks: 2

Open Issues: 1

pkg:composer/malahierba-lab/word-counter

0.1.1 2015-11-17 01:30 UTC

This package is not auto-updated.

Last update: 2025-09-28 00:39:58 UTC


README

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.