serhiime/typos-generator

Generator of typos based on https://github.com/lequer/TyposGenerator

1.0 2019-04-22 11:46 UTC

This package is auto-updated.

Last update: 2024-11-29 01:10:46 UTC


README

Generator of typos based on https://github.com/lequer/TyposGenerator

Code Status

Latest Stable Version Total Downloads License Scrutinizer Code Quality

About

Author: Serhii Nekhaienko <sergey.nekhaenko@gmail.com>
Current Version: 1.0
Stable Version: 1.0
License: MIT

Requirements

PHP 7.0+

Install via Composer

composer require serhiime/typos-generator

Basic Usage

use SerhiiMe\Typos\TyposGenerator;
use SerhiiMe\Typos\Storage\ArrayTyposStorage;
use SerhiiMe\Typos\Keyboard\EnglishKeyboard;

$options = [
     'wrongKeys' => true,
     'missedChars' => true,
     'transposedChars' => false,
     'doubleChars' => false,
     'storage' => ArrayTyposStorage::class,
     'keyboard' => EnglishKeyboard::class
];

$generator = new TyposGenerator($options);

/** @var $oneResult \SerhiiMe\Typos\Storage\ArrayTyposStorage */
$oneResult = $generator->generate('house')[0];

/** @var $listResult array 
List of \SerhiiMe\Typos\Storage\ArrayTyposStorage objects */
$listResult = $generator->generate(['house','abandoned']);