承接 alwayscurious/wonderwords 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

alwayscurious/wonderwords

Composer 安装命令:

composer require alwayscurious/wonderwords

包简介

A wonderful way to generate random words, phrases, and sentences from curated word lists.

README 文档

README

A wonderful way to generate random words, phrases, and sentences from curated word lists.

Installation

composer require alwayscurious/wonderwords

Usage

Basic Usage

use AlwaysCurious\WonderWords\WonderWords;

$ww = new WonderWords();

// Generate a random word
$ww->word();                    // "phoenix"

// Generate a random phrase (adjective + noun)
$ww->phrase();                  // "blazing phoenix"

// Generate a random sentence
$ww->sentence();                // "The fierce dragon roars mightily."

// Generate a slug
$ww->slug();                    // "crimson-falcon"
$ww->slug('_');                 // "crimson_falcon"

Multiple Results

$ww->words('nouns', 3);         // ["phoenix", "glacier", "storm"]
$ww->phrases(5);                // ["bold raven", "cosmic ember", ...]
$ww->sentences(3);              // ["The swift falcon soars boldly.", ...]

Custom Combinations

use AlwaysCurious\WonderWords\WordList;

// Combine any categories in any order
$ww->combine([WordList::ADJECTIVES, WordList::NOUNS, WordList::VERBS]);
// "golden eagle soars"

// Use a custom separator
$ww->separator('-')->phrase();  // "blazing-phoenix"

Word Categories

Built-in categories: adjectives, nouns, verbs, adverbs

$ww->word(WordList::ADJECTIVES);  // "fierce"
$ww->word(WordList::NOUNS);       // "dragon"
$ww->word(WordList::VERBS);       // "roars"
$ww->word(WordList::ADVERBS);     // "mightily"

Custom Word Lists

$ww = new WonderWords();

// Replace a built-in category
$ww->wordList()->setCategory('colors', ['red', 'blue', 'green']);

// Add words to an existing category
$ww->wordList()->addWords(WordList::NOUNS, ['spaceship', 'robot']);

// Use your custom category
$ww->word('colors');             // "blue"

Credits

This package is a PHP port inspired by the Python WonderWords library by mrmaxguns.

License

MIT

统计信息

  • 总下载量: 954
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固