amneale/dictionary

PHP library for loading and reading collections of strings

Installs: 421

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 0

Forks: 0

Open Issues: 1

pkg:composer/amneale/dictionary

v1.1.0 2022-05-31 09:19 UTC

This package is auto-updated.

Last update: 2025-10-06 22:44:35 UTC


README

Build Status Code Quality

Install

Via Composer

$ composer require amneale/dictionary

Usage

Creating a dictionary from strings, and reading the content a random, shuffled order:

$reader = new ShuffleReader();
$dictionary = new Dictionary('foo', 'bar', 'baz');

for ($i = 0; $i < count($dictionary); ++$i) {
    echo $reader->read($dictionary) . "\n";
}

Loading a dictionary from a file:

$dictionary = Dictionary\Loader\SimpleFileLoader::fromFile('/foo/bar/baz.txt');

Loading a dictionary from a CSV file:

$dictionary = Dictionary\Loader\SimpleFileLoader::fromFile('/foo/bar/baz.csv', ',');

Testing

To run automatic code-style fixer

$ make fmt

To run all tests

$ make test