codemasher / uwuify
PHP字符串uwuify库
dev-main
2023-02-05 23:08 UTC
Requires
- php: ^8.1
- ext-mbstring: *
- chillerlan/php-settings-container: ^3.0
Requires (Dev)
- phan/phan: ^5.4
This package is auto-updated.
Last update: 2024-09-06 02:46:13 UTC
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
- 影响用faces(在static $_faces
中定义)替换空格的百分比。actions
- 影响用actions(在static $_actions
中定义)替换空格的百分比。stutter
- 影响添加一些内容以使它结巴的空格的百分比。
许可证
本项目采用MIT许可证 - 有关详细信息,请参阅LICENSE文件