Skip to content

Commit

Permalink
Remove deprecated collation alias
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanseymour committed Sep 26, 2023
1 parent e079ee1 commit 2c03e83
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 10 deletions.
4 changes: 0 additions & 4 deletions envs/collate.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const (
CollationDefault Collation = "default"
CollationConfusables Collation = "confusables"
CollationArabicVariants Collation = "arabic_variants"
CollationArabicFarsi Collation = "arabic_farsi" // deprecated alias
)

type collateTransformer func(string) string
Expand Down Expand Up @@ -54,9 +53,6 @@ var transformers = map[Collation]collateTransformer{
CollationConfusables: func(s string) string {
return strings.ToLower(stringsx.Skeleton(s))
},
CollationArabicFarsi: func(s string) string {
return strings.ToLower(replaceRunes(norm.NFKD.String(s), arabicVariants))
},
CollationArabicVariants: func(s string) string {
return strings.ToLower(replaceRunes(norm.NFKD.String(s), arabicVariants))
},
Expand Down
5 changes: 0 additions & 5 deletions envs/collate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ func TestCollation(t *testing.T) {
"Nyaruka": true,
"𝒩ɣaruka": true,
}},
{envs.CollationArabicFarsi, "٠١٢٣٤٥٦۷٨٩", "۰۱۲۳۴۵۶۷۸۹", map[string]bool{
"٤٥٦۷": false,
"٠١٢٣٤٥٦۷٨٩": true,
"۰۱۲۳۴۵۶۷۸۹": true,
}},
{envs.CollationArabicVariants, "٠١٢٣٤٥٦۷٨٩", "۰۱۲۳۴۵۶۷۸۹", map[string]bool{
"٤٥٦۷": false,
"٠١٢٣٤٥٦۷٨٩": true,
Expand Down
2 changes: 1 addition & 1 deletion flows/routers/cases/tests_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var dmy = envs.NewBuilder().
WithDefaultCountry(i18n.Country("RW")).
Build()
var ara = envs.NewBuilder().
WithInputCollation(envs.CollationArabicFarsi).
WithInputCollation(envs.CollationArabicVariants).
Build()

var assetsJSON = `{
Expand Down

0 comments on commit 2c03e83

Please sign in to comment.