Skip to content

Commit

Permalink
Merge pull request #32 from byllyfish/nickname_strip
Browse files Browse the repository at this point in the history
Don't strip \t, \r, \n either. (See #29)
  • Loading branch information
byllyfish committed Oct 31, 2023
2 parents 6d39c4f + f8c883f commit 01503ea
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 61 deletions.
2 changes: 1 addition & 1 deletion precis_i18n/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def __init__(self, ucd, name, casemap=None):
def additional_mapping_rule(self, value):
# Override
temp = self.base.ucd.map_nonascii_space_to_ascii(value)
return re.sub(r' +', ' ', temp.strip(' \t\n\r'))
return re.sub(r' +', ' ', temp.strip(' '))

def normalization_rule(self, value):
# Override
Expand Down
120 changes: 60 additions & 60 deletions test/golden.json
Original file line number Diff line number Diff line change
Expand Up @@ -5896,19 +5896,19 @@
"profile": "NicknameCaseMapped",
"input": "\t",
"output": null,
"error": "DISALLOWED/empty"
"error": "DISALLOWED/controls"
},
{
"profile": "NicknameCaseMapped",
"input": "\n",
"output": null,
"error": "DISALLOWED/empty"
"error": "DISALLOWED/controls"
},
{
"profile": "NicknameCaseMapped",
"input": "\r",
"output": null,
"error": "DISALLOWED/empty"
"error": "DISALLOWED/controls"
},
{
"profile": "NicknameCaseMapped",
Expand Down Expand Up @@ -5997,14 +5997,14 @@
{
"profile": "NicknameCaseMapped",
"input": "\tA",
"output": "a",
"error": null
"output": null,
"error": "DISALLOWED/controls"
},
{
"profile": "NicknameCaseMapped",
"input": "A\t",
"output": "a",
"error": null
"output": null,
"error": "DISALLOWED/controls"
},
{
"profile": "NicknameCaseMapped",
Expand All @@ -6015,14 +6015,14 @@
{
"profile": "NicknameCaseMapped",
"input": "\nA",
"output": "a",
"error": null
"output": null,
"error": "DISALLOWED/controls"
},
{
"profile": "NicknameCaseMapped",
"input": "A\n",
"output": "a",
"error": null
"output": null,
"error": "DISALLOWED/controls"
},
{
"profile": "NicknameCaseMapped",
Expand All @@ -6033,14 +6033,14 @@
{
"profile": "NicknameCaseMapped",
"input": "\rA",
"output": "a",
"error": null
"output": null,
"error": "DISALLOWED/controls"
},
{
"profile": "NicknameCaseMapped",
"input": "A\r",
"output": "a",
"error": null
"output": null,
"error": "DISALLOWED/controls"
},
{
"profile": "NicknameCaseMapped",
Expand Down Expand Up @@ -9810,19 +9810,19 @@
"profile": "NicknameCasePreserved",
"input": "\t",
"output": null,
"error": "DISALLOWED/empty"
"error": "DISALLOWED/controls"
},
{
"profile": "NicknameCasePreserved",
"input": "\n",
"output": null,
"error": "DISALLOWED/empty"
"error": "DISALLOWED/controls"
},
{
"profile": "NicknameCasePreserved",
"input": "\r",
"output": null,
"error": "DISALLOWED/empty"
"error": "DISALLOWED/controls"
},
{
"profile": "NicknameCasePreserved",
Expand Down Expand Up @@ -9911,14 +9911,14 @@
{
"profile": "NicknameCasePreserved",
"input": "\tA",
"output": "A",
"error": null
"output": null,
"error": "DISALLOWED/controls"
},
{
"profile": "NicknameCasePreserved",
"input": "A\t",
"output": "A",
"error": null
"output": null,
"error": "DISALLOWED/controls"
},
{
"profile": "NicknameCasePreserved",
Expand All @@ -9929,14 +9929,14 @@
{
"profile": "NicknameCasePreserved",
"input": "\nA",
"output": "A",
"error": null
"output": null,
"error": "DISALLOWED/controls"
},
{
"profile": "NicknameCasePreserved",
"input": "A\n",
"output": "A",
"error": null
"output": null,
"error": "DISALLOWED/controls"
},
{
"profile": "NicknameCasePreserved",
Expand All @@ -9947,14 +9947,14 @@
{
"profile": "NicknameCasePreserved",
"input": "\rA",
"output": "A",
"error": null
"output": null,
"error": "DISALLOWED/controls"
},
{
"profile": "NicknameCasePreserved",
"input": "A\r",
"output": "A",
"error": null
"output": null,
"error": "DISALLOWED/controls"
},
{
"profile": "NicknameCasePreserved",
Expand Down Expand Up @@ -11766,19 +11766,19 @@
"profile": "NicknameCaseMapped:ToLower",
"input": "\t",
"output": null,
"error": "DISALLOWED/empty"
"error": "DISALLOWED/controls"
},
{
"profile": "NicknameCaseMapped:ToLower",
"input": "\n",
"output": null,
"error": "DISALLOWED/empty"
"error": "DISALLOWED/controls"
},
{
"profile": "NicknameCaseMapped:ToLower",
"input": "\r",
"output": null,
"error": "DISALLOWED/empty"
"error": "DISALLOWED/controls"
},
{
"profile": "NicknameCaseMapped:ToLower",
Expand Down Expand Up @@ -11867,14 +11867,14 @@
{
"profile": "NicknameCaseMapped:ToLower",
"input": "\tA",
"output": "a",
"error": null
"output": null,
"error": "DISALLOWED/controls"
},
{
"profile": "NicknameCaseMapped:ToLower",
"input": "A\t",
"output": "a",
"error": null
"output": null,
"error": "DISALLOWED/controls"
},
{
"profile": "NicknameCaseMapped:ToLower",
Expand All @@ -11885,14 +11885,14 @@
{
"profile": "NicknameCaseMapped:ToLower",
"input": "\nA",
"output": "a",
"error": null
"output": null,
"error": "DISALLOWED/controls"
},
{
"profile": "NicknameCaseMapped:ToLower",
"input": "A\n",
"output": "a",
"error": null
"output": null,
"error": "DISALLOWED/controls"
},
{
"profile": "NicknameCaseMapped:ToLower",
Expand All @@ -11903,14 +11903,14 @@
{
"profile": "NicknameCaseMapped:ToLower",
"input": "\rA",
"output": "a",
"error": null
"output": null,
"error": "DISALLOWED/controls"
},
{
"profile": "NicknameCaseMapped:ToLower",
"input": "A\r",
"output": "a",
"error": null
"output": null,
"error": "DISALLOWED/controls"
},
{
"profile": "NicknameCaseMapped:ToLower",
Expand Down Expand Up @@ -19591,19 +19591,19 @@
"profile": "NicknameCaseMapped:CaseFold",
"input": "\t",
"output": null,
"error": "DISALLOWED/empty"
"error": "DISALLOWED/controls"
},
{
"profile": "NicknameCaseMapped:CaseFold",
"input": "\n",
"output": null,
"error": "DISALLOWED/empty"
"error": "DISALLOWED/controls"
},
{
"profile": "NicknameCaseMapped:CaseFold",
"input": "\r",
"output": null,
"error": "DISALLOWED/empty"
"error": "DISALLOWED/controls"
},
{
"profile": "NicknameCaseMapped:CaseFold",
Expand Down Expand Up @@ -19692,14 +19692,14 @@
{
"profile": "NicknameCaseMapped:CaseFold",
"input": "\tA",
"output": "a",
"error": null
"output": null,
"error": "DISALLOWED/controls"
},
{
"profile": "NicknameCaseMapped:CaseFold",
"input": "A\t",
"output": "a",
"error": null
"output": null,
"error": "DISALLOWED/controls"
},
{
"profile": "NicknameCaseMapped:CaseFold",
Expand All @@ -19710,14 +19710,14 @@
{
"profile": "NicknameCaseMapped:CaseFold",
"input": "\nA",
"output": "a",
"error": null
"output": null,
"error": "DISALLOWED/controls"
},
{
"profile": "NicknameCaseMapped:CaseFold",
"input": "A\n",
"output": "a",
"error": null
"output": null,
"error": "DISALLOWED/controls"
},
{
"profile": "NicknameCaseMapped:CaseFold",
Expand All @@ -19728,14 +19728,14 @@
{
"profile": "NicknameCaseMapped:CaseFold",
"input": "\rA",
"output": "a",
"error": null
"output": null,
"error": "DISALLOWED/controls"
},
{
"profile": "NicknameCaseMapped:CaseFold",
"input": "A\r",
"output": "a",
"error": null
"output": null,
"error": "DISALLOWED/controls"
},
{
"profile": "NicknameCaseMapped:CaseFold",
Expand Down

0 comments on commit 01503ea

Please sign in to comment.