Text::Guess::Script - Guess script from text using ISO-15924 codes
use Text::Guess::Script; print Text::Guess::Script->guess('Hello World'); # prints Latn print Text::Guess::Script->guesses('Hello World')->[0]->[0]; # Latn print Text::Guess::Script->guesses('Hello World')->[0]->[2]; # Latin print Text::Guess::Script->guesses('Hello World')->[1]->[0]; # Zyyy print Text::Guess::Script->guesses('Hello World')->[1]->[2]; # Common use Data::Dumper; print Dumper(Text::Guess::Script->guesses('Hello World')); $VAR1 = [ [ 'Latn', '0.909090909090909', 'Latin' ], [ 'Zyyy', '0.0909090909090909', 'Common' ] ];
Text::Guess::Script gets the script property for each character in the text and returns the code of the script with the most characters.
Creates a new object which maintains internal storage areas for the Text::Guess::Script computation. Use one of these per concurrent Text::Guess::Script->guess() call.
Returns the script code with the most characters.
Returns an array reference with an array, sorted descending by relative frequency for each script. Each entry is a triple of script code, relative frequency and script name:
$guesses = [ [ 'Latn', '0.909090909090909', 'Latin' ], [ 'Zyyy', '0.0909090909090909', 'Common' ], ];
None by design.
Until release of version 1.00 the included methods, names of methods and their interfaces are subject to change.
Beginning with version 1.00 the specification will be stable, i.e. not changed between major versions.
http://github.com/wollmers/Text-Guess-Script
Helmut Wollmersdorfer <helmut@wollmersdorfer.at>
Copyright 2016-2021 Helmut Wollmersdorfer
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Locale::Codes::Script
To install Text::Guess::Script, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::Guess::Script
CPAN shell
perl -MCPAN -e shell install Text::Guess::Script
For more information on module installation, please visit the detailed CPAN module installation guide.