codemasher/uwuify

PHP字符串uwuify库

dev-main 2023-02-05 23:08 UTC

This package is auto-updated.

Last update: 2024-09-06 02:46:13 UTC


README

使用各种选项来uwuify任何句子或单词。

PHP version >= 8.0 License MIT Download counts, Sorry for screen reader.

安装

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文件