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($word, %options);
Return a list of typos given a word. The only available option at this time is
accents => 1, which enables accent munging.
This module has a "Western European" and QWERTY bias. Ideally, future versions should include options for localization and different keyboards.
Ivan Tubert-Brohman <firstname.lastname@example.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.