-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copied files from mycroft + Initial work on tokenizer.
Tokenizer: Added duration_separator tmp
- Loading branch information
Showing
12 changed files
with
634 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
{ | ||
"decade_format": { | ||
"1": {"match": "^\\d$", "format": "{x}"}, | ||
"2": {"match": "^\\d0$", "format": "{x0}"}, | ||
"3": {"match": "^[2-6]1$", "format": "{x0}-et-un"}, | ||
"4": {"match": "^[2-6|8]\\d$", "format": "{x0}-{x}"}, | ||
"5": {"match": "^\\d{2}$", "format": "{xx}"}, | ||
"default": "{number}" | ||
}, | ||
"hundreds_format": { | ||
"1": {"match": "^\\d{1,2}$", "format": "{formatted_decade}"}, | ||
"2": {"match": "^100$", "format": "cent"}, | ||
"3": {"match": "^\\d00$", "format": "{x_in_x00}-cents"}, | ||
"4": {"match": "^1\\d{2}$", "format": "cent-{formatted_decade}"}, | ||
"5": {"match": "^\\d{3}$", "format": "{x_in_x00}-cent-{formatted_decade}"}, | ||
"default": "{number}" | ||
}, | ||
"thousand_format": { | ||
"1": {"match": "^1000$", "format": "mille"}, | ||
"2": {"match": "^\\d000$", "format": "{x_in_x000}-mille"}, | ||
"3": {"match": "^1\\d{3}$", "format": "mille-{formatted_hundreds}"}, | ||
"4": {"match": "^\\d{4}$", "format": "{x_in_x000}-mille-{formatted_hundreds}"}, | ||
"default": "{number}" | ||
}, | ||
"year_format": { | ||
"1": {"match": "^\\d\\d?$", "format": "{formatted_decade} {bc}"}, | ||
"2": {"match": "^\\d{3}$", "format": "{formatted_hundreds} {bc}"}, | ||
"3": {"match": "^[1-9]\\d{3}$", "format": "{formatted_thousand} {bc}"}, | ||
"default": "{year} {bc}", | ||
"bc": "avant Jésus Christ " | ||
}, | ||
"date_format": { | ||
"date_full": "{weekday} {day} {month} {formatted_year}", | ||
"date_full_no_year": "{weekday} {day} {month}", | ||
"date_full_no_year_month": "{weekday} {day}", | ||
"today": "aujourd'hui", | ||
"tomorrow": "demain", | ||
"yesterday": "hier" | ||
}, | ||
"date_time_format": { | ||
"date_time": "{formatted_date} {formatted_time}" | ||
}, | ||
"weekday": { | ||
"0": "lundi", | ||
"1": "mardi", | ||
"2": "mercredi", | ||
"3": "jeudi", | ||
"4": "vendredi", | ||
"5": "samedi", | ||
"6": "dimanche" | ||
}, | ||
"date": { | ||
"1": "premier", | ||
"2": "deux", | ||
"3": "trois", | ||
"4": "quatre", | ||
"5": "cinq", | ||
"6": "six", | ||
"7": "sept", | ||
"8": "huit", | ||
"9": "neuf", | ||
"10": "dix", | ||
"11": "onze", | ||
"12": "douze", | ||
"13": "treize", | ||
"14": "quatorze", | ||
"15": "quinze", | ||
"16": "seize", | ||
"17": "dix-sept", | ||
"18": "dix-huit", | ||
"19": "dix-neuf", | ||
"20": "vingt", | ||
"21": "vingt-et-un", | ||
"22": "vingt-deux", | ||
"23": "vingt-trois", | ||
"24": "vingt-quatre", | ||
"25": "vingt-cinq", | ||
"26": "vingt-six", | ||
"27": "vingt-sept", | ||
"28": "vingt-huit", | ||
"29": "vingt-neuf", | ||
"30": "trente", | ||
"31": "trente-et-un" | ||
}, | ||
"month": { | ||
"1": "janvier", | ||
"2": "février", | ||
"3": "mars", | ||
"4": "avril", | ||
"5": "mai", | ||
"6": "juin", | ||
"7": "juillet", | ||
"8": "août", | ||
"9": "septembre", | ||
"10": "octobe", | ||
"11": "novembre", | ||
"12": "décembre" | ||
}, | ||
"number": { | ||
"0": "zéro", | ||
"1": "un", | ||
"2": "deux", | ||
"3": "trois", | ||
"4": "quatre", | ||
"5": "cinq", | ||
"6": "six", | ||
"7": "sept", | ||
"8": "huit", | ||
"9": "neuf", | ||
"10": "dix", | ||
"11": "onze", | ||
"12": "douze", | ||
"13": "treize", | ||
"14": "quatorze", | ||
"15": "quinze", | ||
"16": "seize", | ||
"17": "dix-sept", | ||
"18": "dix-huit", | ||
"19": "dix-neuf", | ||
"20": "vingt", | ||
"30": "trente", | ||
"40": "quarante", | ||
"50": "cinquante", | ||
"60": "soixante", | ||
"70": "soixante-dix", | ||
"71": "soixante-et-onze", | ||
"72": "soixante-douze", | ||
"73": "soixante-treize", | ||
"74": "soixante-quatorze", | ||
"75": "soixante-quinze", | ||
"76": "soixante-seize", | ||
"77": "soixante-dix-sept", | ||
"78": "soixante-dix-huit", | ||
"79": "soixante-dix-neuf", | ||
"80": "quatre-vingt", | ||
"90": "quatre-vingt-dix", | ||
"91": "quatre-vingt-onze", | ||
"92": "quatre-vingt-douze", | ||
"93": "quatre-vingt-treize", | ||
"94": "quatre-vingt-quatorze", | ||
"95": "quatre-vingt-quinze", | ||
"96": "quatre-vingt-seize", | ||
"97": "quatre-vingt-dix-sept", | ||
"98": "quatre-vingt-dix-huit", | ||
"99": "quatre-vingt-dix-neuf" | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
numbers/src/main/resources/config/fr-fr/date_time_test.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"test_nice_year": { | ||
"1": {"datetime_param": "1, 1, 31, 13, 22, 3", "bc": "True", "assertEqual": "un avant Jésus Christ" }, | ||
"2": {"datetime_param": "10, 1, 31, 13, 22, 3", "bc": "True", "assertEqual": "dix avant Jésus Christ" }, | ||
"3": {"datetime_param": "92, 1, 31, 13, 22, 3", "bc": "True", "assertEqual": "quatre-vingt-douze avant Jésus Christ" }, | ||
"4": {"datetime_param": "803, 1, 31, 13, 22, 3", "bc": "None", "assertEqual": "huit-cent-trois" }, | ||
"5": {"datetime_param": "111, 1, 31, 13, 22, 3", "bc": "None", "assertEqual": "cent-onze" }, | ||
"6": {"datetime_param": "454, 1, 31, 13, 22, 3", "bc": "None", "assertEqual": "quatre-cent-cinquante-quatre" }, | ||
"7": {"datetime_param": "2005, 1, 31, 13, 22, 3", "bc": "False", "assertEqual": "deux-mille-cinq" }, | ||
"8": {"datetime_param": "1012, 1, 31, 13, 22, 3", "bc": "False", "assertEqual": "mille-douze" }, | ||
"9": {"datetime_param": "1046, 1, 31, 13, 22, 3", "bc": "False", "assertEqual": "mille-quarante-six" }, | ||
"10": {"datetime_param": "1807, 1, 31, 13, 22, 3", "bc": "None", "assertEqual": "mille-huit-cent-sept" }, | ||
"11": {"datetime_param": "1717, 1, 31, 13, 22, 3", "bc": "None", "assertEqual": "mille-sept-cent-dix-sept" }, | ||
"12": {"datetime_param": "1988, 1, 31, 13, 22, 3", "bc": "None", "assertEqual": "mille-neuf-cent-quatre-vingt-huit"}, | ||
"13": {"datetime_param": "2009, 1, 31, 13, 22, 3", "bc": "None", "assertEqual": "deux-mille-neuf"}, | ||
"14": {"datetime_param": "2018, 1, 31, 13, 22, 3", "bc": "None", "assertEqual": "deux-mille-dix-huit"}, | ||
"15": {"datetime_param": "2021, 1, 31, 13, 22, 3", "bc": "None", "assertEqual": "deux-mille-vingt-et-un"}, | ||
"16": {"datetime_param": "2030, 1, 31, 13, 22, 3", "bc": "None", "assertEqual": "deux-mille-trente"}, | ||
"17": {"datetime_param": "2100, 1, 31, 13, 22, 3", "bc": "False", "assertEqual": "deux-mille-cent" }, | ||
"18": {"datetime_param": "1000, 1, 31, 13, 22, 3", "bc": "None", "assertEqual": "mille" }, | ||
"19": {"datetime_param": "2000, 1, 31, 13, 22, 3", "bc": "None", "assertEqual": "deux-mille" }, | ||
"20": {"datetime_param": "3120, 1, 31, 13, 22, 3", "bc": "True", "assertEqual": "trois-mille-cent-vingt avant Jésus Christ" }, | ||
"21": {"datetime_param": "3241, 1, 31, 13, 22, 3", "bc": "True", "assertEqual": "trois-mille-deux-cent-quarante-et-un avant Jésus Christ" }, | ||
"22": {"datetime_param": "5200, 1, 31, 13, 22, 3", "bc": "False", "assertEqual": "cinq-mille-deux-cents" }, | ||
"23": {"datetime_param": "1100, 1, 31, 13, 22, 3", "bc": "False", "assertEqual": "mille-cent" }, | ||
"24": {"datetime_param": "2100, 1, 31, 13, 22, 3", "bc": "False", "assertEqual": "deux-mille-cent" } | ||
}, | ||
"test_nice_date": { | ||
"1": {"datetime_param": "2017, 1, 31, 0, 2, 3", "now": "None", "assertEqual": "mardi trente-et-un janvier deux-mille-dix-sept"}, | ||
"2": {"datetime_param": "2018, 2, 4, 0, 2, 3", "now": "2017, 1, 1, 0, 2, 3", "assertEqual": "dimanche quatre février deux-mille-dix-huit"}, | ||
"3": {"datetime_param": "2018, 2, 4, 0, 2, 3", "now": "2018, 1, 1, 0, 2, 3", "assertEqual": "dimanche quatre février"}, | ||
"4": {"datetime_param": "2018, 2, 4, 0, 2, 3", "now": "2018, 2, 1, 0, 2, 3", "assertEqual": "dimanche quatre"}, | ||
"5": {"datetime_param": "2018, 2, 4, 0, 2, 3", "now": "2018, 2, 3, 0, 2, 3", "assertEqual": "demain"}, | ||
"6": {"datetime_param": "2018, 2, 4, 0, 2, 3", "now": "2018, 2, 4, 0, 2, 3", "assertEqual": "aujourd'hui"}, | ||
"7": {"datetime_param": "2018, 2, 4, 0, 2, 3", "now": "2018, 2, 5, 0, 2, 3", "assertEqual": "hier"}, | ||
"8": {"datetime_param": "2018, 2, 4, 0, 2, 3", "now": "2018, 2, 6, 0, 2, 3", "assertEqual": "dimanche quatre février"}, | ||
"9": {"datetime_param": "2018, 2, 4, 0, 2, 3", "now": "2019, 2, 6, 0, 2, 3", "assertEqual": "dimanche quatre février deux-mille-dix-huit"} | ||
}, | ||
"test_nice_date_time": { | ||
"1": {"datetime_param": "2017, 1, 31, 13, 22, 3", "now": "None", "use_24hour": "False", "use_ampm": "True", "assertEqual": "mardi trente-et-un janvier deux-mille-dix-sept une heure vingt-deux de l'après-midi"}, | ||
"2": {"datetime_param": "2017, 1, 31, 13, 22, 3", "now": "None", "use_24hour": "True", "use_ampm": "False", "assertEqual": "mardi trente-et-un janvier deux-mille-dix-sept treize heures vingt-deux"} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
jour |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
jours |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
heure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
heures |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
minute |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
minutes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
seconde |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
secondes |
Oops, something went wrong.