Skip to content

apie-lib/count-words

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

count-words

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require Code coverage

PHP Composer

This package is part of the Apie library. The code is maintained in a monorepo, so PR's need to be sent to the monorepo

Documentation

This small package contains a class to count words in a text. All words are returned lowercase.

Usage

use Apie\CountWords\WordCounter;

var_dump(WordCounter::countFromString('This is the text with many words like the or and'));

This will echo:

array(10) {
  ["this"]=>
  int(1)
  ["is"]=>
  int(1)
  ["the"]=>
  int(2)
  ["text"]=>
  int(1)
  ["with"]=>
  int(1)
  ["many"]=>
  int(1)
  ["words"]=>
  int(1)
  ["like"]=>
  int(1)
  ["or"]=>
  int(1)
  ["and"]=>
  int(1)
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages