Lingua::PT::Abbrev - An abbreviations dictionary manager for NLP
use Lingua::PT::Abbrev; my $dic = Lingua::PT::Abbrev->new; my $exp = $dic -> expand("sr"); $text = $dic -> text_expand($text);
This module handles a built-in abbreviations dictionary, and a user customized abbreviations dictionary. It provides handy functions for NLP processing.
This is the Lingua::PT::Abbrev dictionaries constructor. You don't need to pass it any parameter, unless you want to maintain a personal dictionary. In that case, pass the path to your personal dictionary file.
The dictionary file is a text file, one abbreviation by line, as:
sr senhor sra senhora dr doutor
Given an abbreviation, this method expands it. For expanding abbreviations in a text use
<text_expand>, a lot faster.
Returns undef if the abbreviation is not known.
Given a text, this method expands all known abbreviations
Use this method to add an abbreviation to your current dictionary.
$abrev -> add( "dr" => "Doutor" );
Use this method to add an abbreviation to your session dictionary.
$abrev -> session_add( "dr" => "Doutor" );
This method saves the custom dictionary
This method returns a regular expression matching all abbreviations. Pass as option an hash table for configuration.
<nodot> is used to define a regular expression not containing the final dot.
Please report any bugs or feature requests to
firstname.lastname@example.org, or through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
Copyright 2004-2005 Alberto Simões, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.