@@ -3,52 +3,76 @@ use rustling_ontology_moment::*;
33use rustling_ontology_values:: dimension:: * ;
44use rustling_ontology_values:: ResolverContext ;
55
6+ pub fn examples_percentage ( v : & mut Vec < :: rustling:: train:: Example < Dimension > > ) {
7+ example ! ( v, check_percentage( 15.0 ) , "15%" , "fünfzehn prozent" , "15 vom Hundert" ) ;
8+ example ! ( v, check_percentage( 3.2 ) , "3,2 %" , "drei komma zwei prozent" , "3,2 vom Hundert" ) ;
9+ }
10+
611pub fn examples_temperature ( v : & mut Vec < :: rustling:: train:: Example < Dimension > > ) {
7- example ! ( v, check_temperature( 10.0 , Some ( "degree" ) ) , "10 Grad" ) ;
8- example ! ( v, check_temperature( -20.0 , None ) , "minus 20" ) ;
9- example ! ( v, check_temperature( -20.0 , Some ( "degree" ) ) , "minus 20 Grad" ) ;
10- example ! ( v, check_temperature( 3.0 , Some ( "degree" ) ) , "plus 3 Grad" ) ;
11- example ! ( v, check_temperature( 71.0 , Some ( "degree" ) ) , "71 Grad" ) ;
12- example ! ( v, check_temperature( -7.0 , Some ( "degree" ) ) , "sieben Grad unter null" ) ;
13- example ! ( v, check_temperature( -10.0 , None ) , "10 unterm gefrierpunkt" ) ;
14- example ! ( v, check_temperature( 5.0 , Some ( "degree" ) ) , "5 grad über null" ) ;
15- example ! ( v, check_temperature( 20.0 , Some ( "degree" ) ) , "20 grad über null" ) ;
16- example ! ( v, check_temperature( 15.0 , Some ( "celsius" ) ) , "15 C" , "15°C" ) ;
17- example ! ( v, check_temperature( 23.0 , Some ( "degree" ) ) , "plus 23 °" , "23°" ) ;
18- example ! ( v, check_temperature( -24.0 , Some ( "degree" ) ) , "minus 24 grad" ) ;
19- example ! ( v, check_temperature( -15.0 , Some ( "degree" ) ) , "15 grad unter den gefrierpunkt" ) ;
20- example ! ( v, check_temperature( -34.0 , Some ( "degree" ) ) , "34 grad unterm gefrierpunkt" ) ;
21- example ! ( v, check_temperature( 13.0 , Some ( "degree" ) ) , "plus 13 grad" ) ;
22- example ! ( v, check_temperature( 130.0 , Some ( "kelvin" ) ) , "130 kelvin" ) ;
23- example ! ( v, check_temperature( 223.0 , Some ( "kelvin" ) ) , "223 k" ) ;
24- example ! ( v, check_temperature( 78.0 , Some ( "fahrenheit" ) ) , "78 fahrenheit" , "78 f" ) ;
25- example ! ( v, check_temperature( 19.0 , Some ( "degree" ) ) , "19 grad über null" ) ;
26- example ! ( v, check_temperature( -18.0 , Some ( "degree" ) ) , "Bei -18 Grad" ) ;
12+ example ! ( v, check_temperature( 3.0 , Some ( "degree" ) ) , "3°" , "3 °" , "plus 3°" , "3 ° über null" ) ;
13+ example ! ( v, check_temperature( 71.0 , Some ( "degree" ) ) , "71 grad" , "71 Grad" , "plus 71 Grad" , "71 Grad über null" , "ein und siebzig Grad" ) ;
14+ example ! ( v, check_temperature( -7.0 , Some ( "degree" ) ) , "-7°" , "-7 Grad" , "minus sieben grad" , "7 Grad unter null" , "sieben grad unter dem gefrierpunkt" , "7 Grad unterm gefrierpunkt" ) ;
15+ example ! ( v, check_temperature( -92.0 , None ) , "zwei und neunzig unter dem gefrierpunkt" , "92 unterm gefrierpunkt" ) ;
16+ example ! ( v, check_temperature( -18.0 , Some ( "degree" ) ) , "bei -18°" , "Bei -18 Grad" ) ;
17+ example ! ( v, check_temperature( 15.0 , Some ( "celsius" ) ) , "15 celsius" , "15 Grad Celsius" , "fünfzehn Grad CELSIUS" , "15 C" , "15°C" ) ;
18+ example ! ( v, check_temperature( -115.0 , Some ( "celsius" ) ) , "minus 115 celsius" , "-115 Grad Celsius" , "minus hundertfünfzehn Grad CELSIUS" , "- 115 C" , "-115°C" ) ;
19+ example ! ( v, check_temperature( 78.0 , Some ( "fahrenheit" ) ) , "78 fahrenheit" , "78 Grad Fahrenheit" , "achtundsiebzig Grad FAHRENHEIT" , "78 f" , "78°F" ) ;
20+ example ! ( v, check_temperature( -78.0 , Some ( "fahrenheit" ) ) , "minus 78 fahrenheit" , "-78 Grad Fahrenheit" , "minus acht und siebzig Grad FAHRENHEIT" , "- 78 f" , "-78°F" ) ;
21+ example ! ( v, check_temperature( 130.0 , Some ( "kelvin" ) ) , "130 kelvin" , "130 Grad Kelvin" , "hundert dreißig Grad KELVIN" , "130 k" , "130°K" ) ;
2722}
2823
2924pub fn examples_finance ( v : & mut Vec < :: rustling:: train:: Example < Dimension > > ) {
30- example ! ( v, check_finance( 30.0 , Some ( "EUR" ) , Precision :: Exact ) , "dreissig Euro" ) ;
3125 example ! ( v, check_finance( 800.0 , Some ( "$" ) , Precision :: Exact ) , "800 dollar" ) ;
32- example ! ( v, check_finance( 800.0 , Some ( "cent" ) , Precision :: Exact ) , "achthundert cent" ) ;
33- example ! ( v, check_finance( 300.0 , Some ( "cent" ) , Precision :: Exact ) , "300 pennies" ) ;
34- example ! ( v, check_finance( 1.0 , Some ( "cent" ) , Precision :: Exact ) , "1 penny" , "1 cent" , "1 cts" , "1 ct" ) ;
35- example ! ( v, check_finance( 4000.0 , Some ( "INR" ) , Precision :: Exact ) , "exakt viertausend rupien" ) ;
36- example ! ( v, check_finance( 980.0 , Some ( "KRW" ) , Precision :: Exact ) , "ganz genau neunhundertachtzig Won" ) ;
37- example ! ( v, check_finance( 478.0 , Some ( "USD" ) , Precision :: Exact ) , "478 US-Dollar" ) ;
38- example ! ( v, check_finance( 2134.0 , Some ( "$" ) , Precision :: Exact ) , "2134 $" ) ;
39- example ! ( v, check_finance( 9840.0 , Some ( "£" ) , Precision :: Exact ) , "9840 £" ) ;
40- example ! ( v, check_finance( 902.0 , Some ( "£" ) , Precision :: Approximate ) , "fast 902 Pfd." ) ;
41- example ! ( v, check_finance( 849.0 , Some ( "EUR" ) , Precision :: Approximate ) , "ungefähr 849 €" ) ;
42- example ! ( v, check_finance( 4775.0 , Some ( "EUR" ) , Precision :: Exact ) , "haargenau 4775 Euro" ) ;
26+ example ! ( v, check_finance( 2134.0 , Some ( "$" ) , Precision :: Exact ) , "2.134 $" ) ;
4327 example ! ( v, check_finance( 90.0 , Some ( "$" ) , Precision :: Exact ) , "präzise neunzig $" ) ;
28+ example ! ( v, check_finance( 478.0 , Some ( "USD" ) , Precision :: Exact ) , "478 US-Dollar" ) ;
29+ example ! ( v, check_finance( 5.0 , Some ( "USD" ) , Precision :: Exact ) , "5 us$" ) ;
4430 example ! ( v, check_finance( 674.0 , Some ( "AUD" ) , Precision :: Exact ) , "674 australische dollar" ) ;
4531 example ! ( v, check_finance( 7438.0 , Some ( "AUD" ) , Precision :: Exact ) , "7438 AUD" ) ;
46- example ! ( v, check_finance( 6739.0 , Some ( "EUR" ) , Precision :: Approximate ) , "cirka 6739 €" ) ;
32+ example ! ( v, check_finance( 8.0 , Some ( "CAD" ) , Precision :: Exact ) , "8Can$" ) ;
33+ example ! ( v, check_finance( 5.0 , Some ( "CAD" ) , Precision :: Approximate ) , "ungefähr fünf Kanadische Dollars" ) ;
34+ example ! ( v, check_finance( 1.0 , Some ( "HKD" ) , Precision :: Exact ) , "eines HKD" ) ;
35+ example ! ( v, check_finance( 12.0 , Some ( "HKD" ) , Precision :: Exact ) , "12 hongkong dollarn" ) ;
36+ example ! ( v, check_finance( 849.0 , Some ( "EUR" ) , Precision :: Approximate ) , "ungefähr 849 €" ) ;
37+ example ! ( v, check_finance( 4775.0 , Some ( "EUR" ) , Precision :: Exact ) , "haargenau 4.775 Euro" ) ;
38+ example ! ( v, check_finance( 30.0 , Some ( "EUR" ) , Precision :: Exact ) , "dreissig Euro" ) ;
39+ example ! ( v, check_finance( 6739.0 , Some ( "EUR" ) , Precision :: Approximate ) , "circa 6739 €" ) ;
4740 example ! ( v, check_finance( 839.0 , Some ( "EUR" ) , Precision :: Approximate ) , "ca 839 €" ) ;
4841 example ! ( v, check_finance( 293.0 , Some ( "EUR" ) , Precision :: Approximate ) , "zirka 293 €" ) ;
49- example ! ( v, check_finance( 230983.0 , Some ( "£" ) , Precision :: Approximate ) , "beinahe 230983 £" ) ;
5042 example ! ( v, check_finance( 150.0 , Some ( "EUR" ) , Precision :: Approximate ) , "nahezu hundertfünfzig Euro" ) ;
43+ example ! ( v, check_finance( 9840.0 , Some ( "£" ) , Precision :: Exact ) , "9840£" ) ;
44+ example ! ( v, check_finance( 902.0 , Some ( "£" ) , Precision :: Approximate ) , "fast 902 Pfd." ) ;
45+ example ! ( v, check_finance( 230983.0 , Some ( "£" ) , Precision :: Approximate ) , "beinahe 230983 £" ) ;
46+ example ! ( v, check_finance( 1000.0 , Some ( "GBP" ) , Precision :: Exact ) , "1000 Pfund Sterling" ) ;
47+ example ! ( v, check_finance( 2.0 , Some ( "CHF" ) , Precision :: Exact ) , "zwei CHF" ) ;
48+ example ! ( v, check_finance( 5.0 , Some ( "CHF" ) , Precision :: Exact ) , "Fünf schweizer Franken" ) ;
49+ example ! ( v, check_finance( 1.0 , Some ( "KR" ) , Precision :: Exact ) , "einer KRONE" ) ;
50+ example ! ( v, check_finance( 17000.0 , Some ( "DKK" ) , Precision :: Exact ) , "siebzehn tausend dänischen kronen" ) ;
51+ example ! ( v, check_finance( 2.2 , Some ( "NOK" ) , Precision :: Exact ) , "genau 2,2 NOK" ) ;
52+ example ! ( v, check_finance( 5.0 , Some ( "NOK" ) , Precision :: Exact ) , "5 norwegischer Kronen" ) ;
53+ example ! ( v, check_finance( 1.0 , Some ( "SEK" ) , Precision :: Exact ) , "einer schwedischen Krone" ) ;
54+ example ! ( v, check_finance( 1000000.0 , Some ( "RUB" ) , Precision :: Approximate ) , "fast eine million ₽" ) ;
55+ example ! ( v, check_finance( 1.0 , Some ( "RUB" ) , Precision :: Exact ) , "1 russischer Rubel" ) ;
5156 example ! ( v, check_finance( 100.0 , Some ( "INR" ) , Precision :: Exact ) , "sehr genau hundert indische Rupien" ) ;
57+ example ! ( v, check_finance( 23.0 , Some ( "INR" ) , Precision :: Exact ) , "drei und zwanzig ₹" ) ;
58+ example ! ( v, check_finance( 4000.0 , Some ( "INR" ) , Precision :: Exact ) , "exakt viertausend rupien" ) ;
59+ example ! ( v, check_finance( 270.0 , Some ( "JPY" ) , Precision :: Exact ) , "270 yen" ) ;
60+ example ! ( v, check_finance( 1.0 , Some ( "CNY" ) , Precision :: Exact ) , "1 Yuan" ) ;
61+ example ! ( v, check_finance( 0.0 , Some ( "¥" ) , Precision :: Exact ) , "0¥" ) ;
62+ example ! ( v, check_finance( 980.0 , Some ( "KRW" ) , Precision :: Exact ) , "ganz genau neunhundertachtzig Won" ) ;
63+ example ! ( v, check_finance( 10.5 , Some ( "KRW" ) , Precision :: Exact ) , "10,5 ₩" ) ;
64+ example ! ( v, check_finance( 1.0 , Some ( "฿" ) , Precision :: Exact ) , "1 bitcoin" ) ;
65+ example ! ( v, check_finance( 10.0 , Some ( "฿" ) , Precision :: Exact ) , "zehn Bitcoins" ) ;
66+ example ! ( v, check_finance( 800.0 , Some ( "cent" ) , Precision :: Exact ) , "achthundert cent" ) ;
67+ example ! ( v, check_finance( 300.0 , Some ( "cent" ) , Precision :: Exact ) , "300 pennies" ) ;
68+ example ! ( v, check_finance( 1.0 , Some ( "cent" ) , Precision :: Exact ) , "1 penny" , "1 cent" , "1 cts" , "1 ct" ) ;
69+ example ! ( v, check_finance( 10.5 , Some ( "EUR" ) , Precision :: Exact ) , "10 € 50 ¢" ) ;
70+ example ! ( v, check_finance( 7.8 , Some ( "$" ) , Precision :: Approximate ) , "fast 7$ 80c" ) ;
71+ example ! ( v, check_finance( 102.1 , Some ( "GBP" ) , Precision :: Exact ) , "hundert zwei britische pfund zehn pennies" ) ;
72+ example ! ( v, check_finance( 105.0 , Some ( "$" ) , Precision :: Exact ) , "einhundert fünf dollar" ) ;
73+ example ! ( v, check_finance( 1047.0 , Some ( "EUR" ) , Precision :: Approximate ) , "ungefähr eintausend siebenundvierzig Euro" ) ;
74+ example ! ( v, check_finance( 1001.0 , Some ( "CHF" ) , Precision :: Exact ) , "tausendeines Schweizer Frankens" ) ;
75+ example ! ( v, check_finance( 500736.0 , Some ( "EUR" ) , Precision :: Exact ) , "fünfhunderttausendsiebenhundertsechsunddreißig euro" ) ;
5276}
5377
5478pub fn examples_time ( v : & mut Vec < :: rustling:: train:: Example < Dimension > > ) {
0 commit comments