diff --git a/envs/collate.go b/envs/collate.go index 7fbf38067..a568edbb6 100644 --- a/envs/collate.go +++ b/envs/collate.go @@ -53,7 +53,7 @@ var transformers = map[Collation]collateTransformer{ return strings.ToLower(stringsx.Skeleton(s)) }, CollationArabicVariants: func(s string) string { - return strings.ToLower(replaceRunes(norm.NFKD.String(s), arabicVariants)) + return strings.ToLower(replaceRunes(norm.NFKC.String(s), arabicVariants)) }, } diff --git a/envs/collate_test.go b/envs/collate_test.go index 8cf07bb37..b0c4b7e4c 100644 --- a/envs/collate_test.go +++ b/envs/collate_test.go @@ -48,6 +48,7 @@ func TestCollation(t *testing.T) { "\u06A9\u0627\u0641": true, // starts with farsi kaf "\uFEDB\u0627\u0641": true, // starts with explicit initial form kaf }}, + {envs.CollationArabicVariants, "\u0622", "\u0627", map[string]bool{}}, {envs.CollationArabicVariants, "\uFE8F\uFEDD\uFBFC", "\u0628\u0644\u06CC", map[string]bool{}}, // Arabic Presentation forms {envs.CollationArabicVariants, "YES", "yes", map[string]bool{"yes": true, "no": false}}, } diff --git a/go.mod b/go.mod index 87bf8c5c0..6740bd695 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/blevesearch/segment v0.9.1 github.com/buger/jsonparser v1.1.1 github.com/go-playground/validator/v10 v10.14.1 - github.com/nyaruka/gocommon v1.42.3 + github.com/nyaruka/gocommon v1.42.4 github.com/olivere/elastic/v7 v7.0.32 github.com/pkg/errors v0.9.1 github.com/sergi/go-diff v1.3.1 diff --git a/go.sum b/go.sum index 9dd782f41..22878a5b0 100644 --- a/go.sum +++ b/go.sum @@ -48,8 +48,8 @@ github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/nyaruka/gocommon v1.42.3 h1:o6C5l3WSOfatMFwTA1rYV62vfwHTuEtvk7k6zB6G1Mc= -github.com/nyaruka/gocommon v1.42.3/go.mod h1:uLZztOOculeX3h20LkabmdkE4UpAEOffBlJ47HbLjM4= +github.com/nyaruka/gocommon v1.42.4 h1:fsB+Sx+WQAdV7j1nX1fTMAb8UVH4jPL4Hkn+nCgpRtU= +github.com/nyaruka/gocommon v1.42.4/go.mod h1:uLZztOOculeX3h20LkabmdkE4UpAEOffBlJ47HbLjM4= github.com/nyaruka/null/v2 v2.0.3 h1:rdmMRQyVzrOF3Jff/gpU/7BDR9mQX0lcLl4yImsA3kw= github.com/nyaruka/null/v2 v2.0.3/go.mod h1:OCVeCkCXwrg5/qE6RU0c1oUVZBy+ZDrT+xYg1XSaIWA= github.com/nyaruka/phonenumbers v1.1.9 h1:/7bJVqIWLb+5erm10aMlojaKhXoMM6JKmlWLNg5laYc=