NAME

Lingua::POR::Words2Nums - Converts Portuguese words to numbers

VERSION

version 0.2603300

SYNOPSIS

use Lingua::POR::Words2Nums qw/word2num/;

$result = num2word("cinco");
# $result now holds 5

DESCRIPTION

Word 2 number conversion in POR.

Words2Nums converts Portuguese words to numbers (works with numbers ranging from 0 to 999.999.999.999.999.999).

Not all possible ways to write a number have been implemented (some people write "nove mil novecentos e um", some people write "nove mil, novecentos e um"; Words2Nums currently supports only the first way, without commas; also, the word "bilião" is supported, but not "bilhão").

word2num

Turns a word into a number

ordinal2cardinal

1   str    ordinal text (e.g. 'primeiro', 'segundo', 'décimo')
=>  str    cardinal text (e.g. 'um', 'dois', 'dez')
    undef  if input is not recognised as an ordinal

Convert Portuguese ordinal text to cardinal text (morphological reversal).

$result = num2word("cinco");
# $result now holds 5

TO DO

Implement function is_number()
ordinal2cardinal (positional)
1   str    ordinal text
=>  str    cardinal text
    undef  if input is not recognised as an ordinal

Convert ordinal text to cardinal text (morphological reversal).

SEE ALSO

More tools for the Portuguese language processing can be found at the Natura project: http://natura.di.uminho.pt

AUTHORS

initial coding:
  Jose Castro E<lt>cog@cpan.orgE<gt>
specification, maintenance:
  Richard C. Jelinek E<lt>rj@petamem.comE<gt>
maintenance, coding (2025-present):
  PetaMem AI Coding Agents

COPYRIGHT & LICENSE

Copyright 2004 Jose Castro, All Rights Reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

LICENSE

This module is free software; you can redistribute it and/or modify it under the same terms as the Artistic License 2.0 or the BSD 2-Clause License. See the LICENSE file in the distribution for details.