NAME
Lingua::PT::Abbrev - An abbreviations dictionary manager for NLP
VERSION
Version 0.10
SYNOPSIS
use Lingua::PT::Abbrev;
my $dic = Lingua::PT::Abbrev->new;
my $exp = $dic -> expand("sr");
$text = $dic -> text_expand($text);
ABSTRACT
This module handles a built-in abbreviations dictionary, and a user customized abbreviations dictionary. It provides handy functions for NLP processing.
FUNCTIONS
new
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
expand
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.
text_expand
Given a text, this method expands all known abbreviations
add
Use this method to add an abbreviation to your current dictionary.
$abrev -> add( "dr" => "Doutor" );
session_add
Use this method to add an abbreviation to your session dictionary.
$abrev -> session_add( "dr" => "Doutor" );
save
This method saves the custom dictionary
regexp
This method returns a regular expression matching all abbreviations. Pass as option an hash table for configuration.
The key <nodot
> is used to define a regular expression not containing the final dot.
AUTHOR
Alberto Simões, <ambs@cpan.org>
BUGS
Please report any bugs or feature requests to bug-lingua-pt-abbrev@rt.cpan.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 & LICENSE
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.