for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use TextUtils\NGram;
if (! function_exists('bigram')) {
/**
* Generate a bi-gram for the provided string.
*
* @param string $text
* @throws \TextUtils\Exceptions\InvalidArgumentException
* @return array
*/
function bigram(string $text)
{
return NGram::bigram($text);
}
if (! function_exists('trigram')) {
* Generate a tri-gram for the provided string.
function trigram(string $text)
return NGram::trigram($text);
if (! function_exists('ngram')) {
* @param int $length
function ngram(string $text, int $length = 3)
return NGram::for($text, $length);