Skip to content

Commit

Permalink
Merge pull request Humanizr#582 from hangy/issue578
Browse files Browse the repository at this point in the history
Pass through the content of the "Letter, other" Unicode category.
  • Loading branch information
Oren Novotny authored Oct 15, 2016
2 parents b15f5e7 + 65e123f commit 289f97f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/Humanizer.Tests.Shared/StringHumanizeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ public void CanHumanizeStringInPascalCaseInTurkish(string input, string expected
Assert.Equal(expectedResult, input.Humanize());
}

[Theory, UseCulture("ar")]
[InlineData("جمهورية ألمانيا الاتحادية", "جمهورية ألمانيا الاتحادية")]
public void CanHumanizeOtherUnicodeLetter(string input, string expectedResult)
{
Assert.Equal(expectedResult, input.Humanize());
}

[Theory]
[InlineData("Underscored_input_string_is_turned_into_sentence", "Underscored input string is turned into sentence")]
[InlineData("Underscored_input_String_is_turned_INTO_sentence", "Underscored input String is turned INTO sentence")]
Expand Down
2 changes: 1 addition & 1 deletion src/Humanizer/StringHumanizeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static class StringHumanizeExtensions

static StringHumanizeExtensions()
{
PascalCaseWordPartsRegex = new Regex(@"[\p{Lu}]?[\p{Ll}]+|[0-9]+[\p{Ll}]*|[\p{Lu}]+(?=[\p{Lu}][\p{Ll}]|[0-9]|\b)",
PascalCaseWordPartsRegex = new Regex(@"[\p{Lu}]?[\p{Ll}]+|[0-9]+[\p{Ll}]*|[\p{Lu}]+(?=[\p{Lu}][\p{Ll}]|[0-9]|\b)|[\p{Lo}]+",
RegexOptions.IgnorePatternWhitespace | RegexOptions.ExplicitCapture | RegexOptionsUtil.Compiled);
FreestandingSpacingCharRegex = new Regex(@"\s[-_]|[-_]\s", RegexOptionsUtil.Compiled);
}
Expand Down

0 comments on commit 289f97f

Please sign in to comment.