承接 iritesh37/random-word-generator 相关项目开发

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

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

iritesh37/random-word-generator

最新稳定版本:v1.0.1

Composer 安装命令:

composer require iritesh37/random-word-generator

包简介

Generates random words by combining adjectives and nouns

README 文档

README

This package helps to generate creative words by randomly combining adjectives and nouns. This is useful for situations in which you need to generate a name that is unique or memorable.

Installation

To install the package, run the following command:

composer require iritesh37/random-word-generator

Usage

<?php

use Iritesh37\RandomWordGenerator\Generator;

echo Generator::generate(); // Outputs 'ancient butterfly', 'celestial flower', etc.

It's also possible to use a custom separator character, by passing it as the first argument:

<?php

use Iritesh37\RandomWordGenerator\Generator;

echo Generator::generate('-'); // Outputs 'ancient-butterfly', 'celestial-flower', etc.

If you need words of a certain length or complexity, you can use the second argument to increase the number of adjectives used:

<?php

use Iritesh37\RandomWordGenerator\Generator;

echo Generator::generate('-', 4); // Outputs 'ancient-butterfly-celestial-flower', etc.

Custom Word Lists

It is also possible to override the adjectives and nouns that can be used to generate the random phrases. For example, you may wish to do this if you want to use words that are themed or branded to your project.

To override the adjectives and nouns at the same time, you can pass an array of strings for both the first and second parameter:

<?php

use Iritesh37\RandomWordGenerator\Generator;

$adjectives = ['adjective one', 'adjective two'];
$nouns = ['noun one', 'noun two'];

Generator::setWordLists($adjectives, $nouns);

If you only wish to override the adjectives, you can use the following:

<?php

use Iritesh37\RandomWordGenerator\Words\Adjective;

$adjectives = ['adjective one', 'adjective two'];

Adjective::setWordList($adjectives);

If you only wish to override the nouns, you can use the following:

<?php

use Iritesh37\RandomWordGenerator\Words\Noun;

$nouns = ['noun one', 'noun two'];

Noun::setWordList($nouns);

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-03-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固