nemo9l / uwuify
此包已被废弃,不再维护。未建议替代包。
PHP的字符串uwuify库
1.0.0
2022-10-02 18:56 UTC
Requires
- php: >=8.0
README
使用各种选项对任何句子或单词进行uwuify。
安装
composer require nemo9l/uwuify composer install
使用方法
基本用法
$uwuifier = new Nemo9l\Uwuify\Uwuify(); $result = $uwuifier->uwuify('Uwuify any sentence or word with various options.');
高级用法
// (float $regexModifier = null, float $exclamationModifier = null, array $spaceModifier = []) $uwuifier = new Nemo9l\Uwuify\Uwuify(0.75, 0.75, [ 'faces' => 0.025, 'actions' => 0.025, 'stutter' => 0.05 ]); $result = $uwuifier->uwuify('Uwuify any sentence or word with various options.');
$regexModifier
$regexModifier
属性影响regex(在static $_regexMaps
中定义)替换应用于句子的百分比。
默认值为1.0
,表示100%的regex替换将被应用。
$exclamationModifier
$exclamationModifier
属性影响感叹号(在static $_exclamations
中定义)的替换百分比。
$spaceModifier
$spaceModifier
属性影响使用各种选项替换空格的百分比。它可以是一个具有以下键的数组:
faces
- 影响替换为表情的百分比(在static $_faces
中定义)。actions
- 影响替换为动作的百分比(在static $_actions
中定义)。stutter
- 影响添加一些后缀使句子拖沓的百分比。
许可
此项目使用MIT许可证 - 有关详细信息,请参阅LICENSE文件。