Skip to content

Commit

Permalink
telephoyn first
Browse files Browse the repository at this point in the history
  • Loading branch information
pablodz committed May 14, 2024
1 parent 65c510f commit 19d13da
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
5 changes: 3 additions & 2 deletions itn/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ func NewLanguageES() *Language {
"nueve": 9,
"un": 1, // optional
"una": 1, // optional

},
STens: map[string]int{
"diez": 10,
Expand All @@ -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,
Expand Down Expand Up @@ -131,7 +132,7 @@ func NewLanguageES() *Language {
And: "y",
NeverIfAlone: []string{
"un",
"uno",
// "uno", // Telephony first
"una",
},
Relaxed: map[string]RelaxTuple{},
Expand Down
12 changes: 10 additions & 2 deletions itn/es_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 19d13da

Please sign in to comment.