An open API service indexing awesome lists of open source software.

https://github.com/qanu/p5-unicode-number

:globe_with_meridians::1234: interface for libuninum
https://github.com/qanu/p5-unicode-number

cpan

Last synced: 25 days ago
JSON representation

:globe_with_meridians::1234: interface for libuninum

Awesome Lists containing this project

README

          

=pod

=encoding UTF-8

=head1 NAME

Unicode::Number - handle numerals in Unicode using the libuninum library

=head1 VERSION

version 0.009

=head1 SYNOPSIS

use Unicode::Number;

my $u = Unicode::Number->new;
my $lao_str = "\x{0ED5}\x{0ED7}\x{0ED6}";
my $ns = $u->guess_number_system($lao_str);
say $u->string_to_number($ns, $lao_str)->to_string; # 576

=head1 DESCRIPTION

This class is used to interface with the C library to convert to and
from different number system representations. It can be used to convert from a
UTF-8 string to one of the types supported by L.

=head1 METHODS

=head2 new

C

Returns a new instance of L.

=head2 number_systems

C

Returns an arrayref of L instances.

=head2 get_number_system_by_name

C

Returns the L that has the name given by the $name
parameter (string) or C if not found.

=head2 string_to_number

C

Returns a L that contains the results of converting
the string given in the $digits_string parameter to a number in the number
system represented by the $number_system parameter.

The value of $number_system can either be a L instance
or a string (see L.)

The value of $digits_string must be encoded in UTF-8.

=head2 number_to_string

C

Returns a UTF-8 encoded string that represents the value of $number in the
number system represented by $number_system.

The value of $number_system can either be a L instance
or a string (see L.)

The value of $number can be either a numeric integer value or a string that
matches the regular expression C[0-9]+/>.

=head2 guess_number_system

C

Returns the L that matches the contents of the numbers
in the string $digits_string if it can be found.

In the special case when $digits_string contains only '0', then it returns a
L with the name 'All_Zero' because several number
systems make overlapping use of this glyph.

Otherwise, if the number system is unknown, returns C.

The value of $digits_string must be encoded in UTF-8.

=head2 version

C

Returns a string with the version of the libuninum library.

=head1 SEE ALSO

L

L

=head1 AUTHOR

Zakariyya Mughal

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by Zakariyya Mughal.

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

=cut