Download the PHP package tuxonice/words without Composer
On this page you can find all versions of the php package tuxonice/words. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tuxonice/words
More information about tuxonice/words
Files in tuxonice/words
Package words
Short Description A PHP package for generating pronounceable language-like words
License MIT
Homepage https://github.com/tuxonice/words
Informations about the package words
Word Generator
A PHP package for generating pronounceable words based on language-specific phonetic patterns. Perfect for creating fictional names, placeholder text, or language generation experiments.
Features
- Generate random words based on language-specific letter transition probabilities
- Support for multiple languages (currently Portuguese and Spanish)
- Standard mode with authentic language-specific phonetic patterns
- Easy mode with simpler letter combinations for easier pronunciation
- Command-line interface for quick word generation
- Configurable maximum word length and quantity
- Option to save generated words to a file
- Extensible design for adding new languages
- Fully object-oriented implementation with PSR-4 autoloading
Installation
Via Composer
Manual Installation
Usage
Word Length Behavior
The generateWord() and generateWords() methods accept a length parameter that specifies the maximum length of the generated words. The actual length of generated words may be shorter depending on the language's phonetic patterns and transition rules. This approach ensures more natural-sounding words while still keeping them within the desired length constraints.
Basic Usage
Package Structure
Sample Output
Extending with New Languages
The package is designed to be easily extended with new languages. To add support for a new language:
- Create a new class in the
src/Matrixdirectory that extendsLanguageMatrix - Implement the required methods:
getLanguageCode(): Return the language code (e.g., 'en', 'fr')getLanguageName(): Return the full language name (e.g., 'English', 'French')createStandard(): Create a standard transition matrix for the languagecreateEasyMode(): Create a simplified transition matrix for the language
Example:
- Update the
createMatrixForLanguage()method inWordGeneratorFacadeto include your new language:
Running Tests
Using Composer
Using Docker
A Docker environment is provided for easy testing without installing PHP locally.
License
MIT
All versions of words with dependencies
ext-mbstring Version *