App::Brl2Brl - Convert between braille display tables defined in Liblouis.
Version 0.05
This module is useful if you have a text coded for one braille character set and need to convert it to another, e.g. you have a text in North American ASCII or Eurobraille and you need it in Unicode braille.
use App::Brl2Brl; my $brl_obj = App::Brl2Brl->new({ # to read in the specified files and store the characters/dots in hashes from_table_file => 'en-us-brf.dis', # or another display table to_table_file => 'unicode.dis', # or another display table warn => 1, # if you want to be warned if a char isn't defined in table }); my $out = $brl_obj->switch_brl_char_map('ABC123'); # switch from BRF to Unicode braille print "$out\n";
Or you may do:
use App::Brl2Brl; my $from_table_file = 'en-us-brf.dis'; my $to_table_file = 'unicode.dis'; my %from_table = parse_dis( "$from_table_file" ); my %to_table = parse_dis( "$to_table_file" ); while( <> ){ my $out = Conv( \%from_table, \%to_table, $_); print "$out\n"; };
parse_dis - Parses a given display table
Conv - Convert from one display table to another.
Takes the following parameters:
path => '/usr/share/liblouis/tables', # path to liblouis tables from_table_file => 'en-us-brf.dis', # or another display table to_table_file => 'unicode.dis', # or another display table warn => 1, # if you want to be warned if a char isn't defined in table
The path is optional. App::Brl2Brl comes with a copy of the data files and knows where to find them. Only provide this if you want to use a different set of data files, perhaps a more recent one. As with most liblouis software you can also set LOUIS_TABLEPATH in your environment.
LOUIS_TABLEPATH
The order of precedence is that the value in a path argument will be used, falling back to LOUIS_TABLEPATH, falling back to using the data bundled with the module.
path
Switch a character or string of characters from one character set to another, defined by from_table and to_table set in the new function.
Parses a liblouis display table file (.dis) and return a hash with the characters and dots respectively.
Converts a string, character by character, from %from_table to %to_table.
Lars Bjørndal, <lars at lamasti.net>
<lars at lamasti.net>
Please report any bugs or feature requests to bug-app-brl2brl at rt.cpan.org, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=App-Brl2Brl. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-app-brl2brl at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc App::Brl2Brl
and
perldoc brl2brl
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
https://rt.cpan.org/NoAuth/Bugs.html?Dist=App-Brl2Brl
CPAN Ratings
https://cpanratings.perl.org/d/App-Brl2Brl
Search CPAN
https://metacpan.org/release/App-Brl2Brl
This software is Copyright (c) 2023 by Lars Bjørndal.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
It includes data files in the share directory copied from v3.26.0 of liblouis. Liblouis is free software licensed under the GNU LGPLv2.1+ (see the file COPYING.LESSER).
share
To install App::Brl2Brl, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::Brl2Brl
CPAN shell
perl -MCPAN -e shell install App::Brl2Brl
For more information on module installation, please visit the detailed CPAN module installation guide.