From 19d13da816b173d5d470bbbbc02fbb43ad54c514 Mon Sep 17 00:00:00 2001 From: Pablo Diaz Date: Tue, 14 May 2024 17:18:14 -0500 Subject: [PATCH] telephoyn first --- itn/base.go | 5 +++-- itn/es_test.go | 12 ++++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/itn/base.go b/itn/base.go index 3f59d9a..b960d97 100644 --- a/itn/base.go +++ b/itn/base.go @@ -48,7 +48,6 @@ func NewLanguageES() *Language { "nueve": 9, "un": 1, // optional "una": 1, // optional - }, STens: map[string]int{ "diez": 10, @@ -73,6 +72,8 @@ func NewLanguageES() *Language { "veintinueve": 29, "veintitrés": 23, // with accent "veintidós": 22, // with accent + "dieciséis": 16, // with typo + "veintiséis": 26, // with typo }, MTens: map[string]int{ "treinta": 30, @@ -131,7 +132,7 @@ func NewLanguageES() *Language { And: "y", NeverIfAlone: []string{ "un", - "uno", + // "uno", // Telephony first "una", }, Relaxed: map[string]RelaxTuple{}, diff --git a/itn/es_test.go b/itn/es_test.go index b8b6014..e3313b3 100644 --- a/itn/es_test.go +++ b/itn/es_test.go @@ -35,6 +35,14 @@ func TestAlpha2Digit(t *testing.T) { input: "un dos tres cuatro veinte quince", output: "1 2 3 4 20 15", }, + { + input: "uno cero treinta y siete", // Telephony first + output: "1 037", // Telephony first + }, + { + input: "veintitrés dos cuatro", // Telephony first + output: "23 2 4", // Telephony first + }, { input: "veintiuno, treinta y uno.", output: "21, 31.", @@ -88,8 +96,8 @@ func TestAlpha2Digit(t *testing.T) { output: "Un momento por favor! 31 gatos. 1 2 3 4!", }, { - input: "Ni uno. Uno uno. Treinta y uno", - output: "Ni uno. 1 1. 31", + input: "Ni uno. Uno uno. Treinta y uno", // Telephony first + output: "Ni 1. 1 1. 31", // Telephony first }, { input: "un millon",