NAME

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

VERSION

Version 0.03

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
  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
});
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 $table_path = '/usr/share/liblouis/tables/';
my $from_table_file = 'en-us-brf.dis';
my $to_table_file = 'unicode.dis';

my %from_table = parse_dis( "$table_path/$from_table_file" );
my %to_table = parse_dis( "$table_path/$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

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)