Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak Arabic Variants collation #1196

Merged
merged 1 commit into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion envs/collate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
},
}

Expand Down
1 change: 1 addition & 0 deletions envs/collate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}},
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
Loading