NAME

App::Brl2Brl - Convert between braille display tables defined in Liblouis.

VERSION

Version 0.05

SYNOPSIS

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";
};

EXPORT

parse_dis - Parses a given display table

Conv - Convert from one display table to another.

SUBROUTINES/METHODS

new

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.

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.

switch_brl_char_map

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.

parse_dis

Parses a liblouis display table file (.dis) and return a hash with the characters and dots respectively.

Conv

Converts a string, character by character, from %from_table to %to_table.

AUTHOR

Lars Bjørndal, <lars at lamasti.net>

BUGS

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.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc App::Brl2Brl

and

perldoc brl2brl

You can also look for information at:

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

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).