nulib-base/php/src/text/words.php

20 lines
495 B
PHP

<?php
namespace nulib\text;
class words {
static function with($spec): Word {
if ($spec instanceof Word) return $spec;
else return new Word(strval($spec));
}
static function q(int $count, string $spec, bool $adjective=true): string {
$word = new Word($spec, $adjective);
return $word->q($count);
}
static function r(int $count, int $max, string $spec, bool $adjective=true): string {
$word = new Word($spec, $adjective);
return $word->r($count, $max);
}
}