-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathNumericWordForms-parsing-examples.raku
84 lines (73 loc) · 2.58 KB
/
NumericWordForms-parsing-examples.raku
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
use v6;
use Lingua::NumericWordForms;
#my @commands = (
#'thirty eight',
#'thirty - eight',
#'thirty-eight',
#'five hundred thirty eight',
#'thirty - eight thousand',
#'thirty-eight thousand',
#'thirty eight thousand',
#'three hundred and thirty eight',
#'three hundred thirty eight',
#'two hundred and thirty eight thousand',
#'two hundred thirty eight thousand',
#'fifteen hundred',
#'one thousand and five hundred',
#'six hundred million',
#'thirteen hundred ninety nine million');
# use sparrow to generate twenty tests for dfdd32 in bash and raku
#
say from-numeric-word-form('languages'):group;
my $spec = 'τετρακόσια είκοσι επτά; триста и две хиляди и трийсет';
say from-numeric-word-form($spec):p:!number;
my @specs = ('nagripru',
'двадесет и три',
'τετρακόσια είκοσι επτά',
'二十万六十五',
'tysiąc dwadzieścia trzy',
'un mil ciento seis',
'six hundred million eight hundred and twelve',
'one hundred twenty third',
'триста и две хиляди и трийсет',
'quatre-vingt-dix-neuf mille quatre-vingt-cinq');
say from-numeric-word-form(@specs):p:!number;
#my $spec = 'tysiąc dwadzieścia trzy';
#say 'word form : ' , $spec;
#say 'translation : ', translate-numeric-word-form( $spec, 'Polish' => 'English' );
#
#$spec = 'mil quinientos treinta y cinco';
#say 'word form : ' , $spec;
#say 'translation : ', translate-numeric-word-form( $spec, 'Spanish' => 'English' );
my @commands = (
'二十六十五',
'چهل و هشت',
'صد و بیست و پنج',
'setecientos treinta y un',
'un mil ciento seis',
'veintinueve',
'mil quinientos treinta y cinco',
'tysiąc dwadzieścia trzy',
'fifteen hundred and twenty five',
'one thousand and five hundred',
'thousand and five hundred',
'six hundred million',
'thirteen hundred ninety nine million',
'четиридесет и осем',
'четирсет и осем',
'сто двайсе и пет',
'двеста петдесет и три',
'две хиляди и трийсет',
'хиляда и трийсет',
'седемдесе и пет милиона, триста и осем хиляди и двеста петдесе и три'
);
#for @commands -> $c {
# say "=" x 60;
# say $c;
# my $res = from-numeric-word-form($c, 'Automatic', :number, :p);
# if $res {
# say "-" x 40;
# say 'from ', $res.key, ' word form: ', $res.value ;
# say 'to English word form : ', to-numeric-word-form($res.value, 'English');
# }
#};