Lingua::TypoGenerator - Generate plausible typos for a word
use Lingua::TypoGenerator 'typos'; my @typos = typos("information"); # returns qw(ibformation, ifnormation, iformation, iiformation, ...) # use accents @typos = typos("año", accents => 1); # returns qw(aao, aaño, ano, ao, aoñ, añ, añi, añp...)
This module has a single exportable function, typos, which, given a string, returns a list of "plausible typos". It works by deleting characters, duplicating characters, transposing adjacent characters, and replacing characters by adjacent keys in the QWERTY keyboard. It can also optionally add, remove or change the type of accent in a character.
typos
@typos = typos($word, %options);
Return a list of typos given a word. The only available option at this time is accents => 1, which enables accent munging.
accents => 1
This module has a "Western European" and QWERTY bias. Ideally, future versions should include options for localization and different keyboards.
Ivan Tubert-Brohman <itub@cpan.org>
Copyright (c) 2004 Ivan Tubert-Brohman. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in 'typos("año",'. Assuming UTF-8
To install Lingua::TypoGenerator, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Lingua::TypoGenerator
CPAN shell
perl -MCPAN -e shell install Lingua::TypoGenerator
For more information on module installation, please visit the detailed CPAN module installation guide.