diff --git a/src/ICU4N.Transliterator/Text/CaseFoldTransliterator.cs b/src/ICU4N.Transliterator/Text/CaseFoldTransliterator.cs index 6bdbd3ddf..80784f9ac 100644 --- a/src/ICU4N.Transliterator/Text/CaseFoldTransliterator.cs +++ b/src/ICU4N.Transliterator/Text/CaseFoldTransliterator.cs @@ -29,7 +29,7 @@ internal static void Register() Transliterator.RegisterSpecialInverse("CaseFold", "Upper", false); } - private readonly UCaseProps csp; + private readonly UCaseProperties csp; private ReplaceableContextEnumerator iter; private StringBuilder result; @@ -39,7 +39,7 @@ internal static void Register() public CaseFoldTransliterator() : base(_ID, null) { - csp = UCaseProps.Instance; + csp = UCaseProperties.Instance; iter = new ReplaceableContextEnumerator(); result = new StringBuilder(); } @@ -90,7 +90,7 @@ protected override void HandleTransliterate(IReplaceable text, /* c mapped to itself, no change */ continue; } - else if (c <= UCaseProps.MaxStringLength) + else if (c <= UCaseProperties.MaxStringLength) { /* replace by the mapping string */ delta = iter.Replace(result.ToString()); diff --git a/src/ICU4N.Transliterator/Text/LowercaseTransliterator.cs b/src/ICU4N.Transliterator/Text/LowercaseTransliterator.cs index 230443ab2..84c936541 100644 --- a/src/ICU4N.Transliterator/Text/LowercaseTransliterator.cs +++ b/src/ICU4N.Transliterator/Text/LowercaseTransliterator.cs @@ -35,7 +35,7 @@ internal static void Register() private readonly ULocale locale; - private readonly UCaseProps csp; + private readonly UCaseProperties csp; private ReplaceableContextEnumerator iter; private StringBuilder result; private CaseLocale caseLocale; @@ -47,10 +47,10 @@ public LowercaseTransliterator(ULocale loc) : base(_ID, null) { locale = loc; - csp = UCaseProps.Instance; + csp = UCaseProperties.Instance; iter = new ReplaceableContextEnumerator(); result = new StringBuilder(); - caseLocale = UCaseProps.GetCaseLocale(locale); + caseLocale = UCaseProperties.GetCaseLocale(locale); } /// @@ -99,7 +99,7 @@ protected override void HandleTransliterate(IReplaceable text, /* c mapped to itself, no change */ continue; } - else if (c <= UCaseProps.MaxStringLength) + else if (c <= UCaseProperties.MaxStringLength) { /* replace by the mapping string */ delta = iter.Replace(result.ToString()); diff --git a/src/ICU4N.Transliterator/Text/TitlecaseTransliterator.cs b/src/ICU4N.Transliterator/Text/TitlecaseTransliterator.cs index 62314700e..b27f71699 100644 --- a/src/ICU4N.Transliterator/Text/TitlecaseTransliterator.cs +++ b/src/ICU4N.Transliterator/Text/TitlecaseTransliterator.cs @@ -32,7 +32,7 @@ internal static void Register() private readonly ULocale locale; - private readonly UCaseProps csp; + private readonly UCaseProperties csp; private ReplaceableContextEnumerator iter; private StringBuilder result; private CaseLocale caseLocale; @@ -46,10 +46,10 @@ public TitlecaseTransliterator(ULocale loc) locale = loc; // Need to look back 2 characters in the case of "can't" MaximumContextLength = 2; - csp = UCaseProps.Instance; + csp = UCaseProperties.Instance; iter = new ReplaceableContextEnumerator(); result = new StringBuilder(); - caseLocale = UCaseProps.GetCaseLocale(locale); + caseLocale = UCaseProperties.GetCaseLocale(locale); } /// @@ -147,7 +147,7 @@ protected override void HandleTransliterate(IReplaceable text, /* c mapped to itself, no change */ continue; } - else if (c <= UCaseProps.MaxStringLength) + else if (c <= UCaseProperties.MaxStringLength) { /* replace by the mapping string */ delta = iter.Replace(result.ToString()); diff --git a/src/ICU4N.Transliterator/Text/UppercaseTransliterator.cs b/src/ICU4N.Transliterator/Text/UppercaseTransliterator.cs index 8396ff057..176a04509 100644 --- a/src/ICU4N.Transliterator/Text/UppercaseTransliterator.cs +++ b/src/ICU4N.Transliterator/Text/UppercaseTransliterator.cs @@ -30,7 +30,7 @@ internal static void Register() private readonly ULocale locale; - private readonly UCaseProps csp; + private readonly UCaseProperties csp; private ReplaceableContextEnumerator iter; private StringBuilder result; private CaseLocale caseLocale; @@ -42,10 +42,10 @@ public UppercaseTransliterator(ULocale loc) : base(_ID, null) { locale = loc; - csp = UCaseProps.Instance; + csp = UCaseProperties.Instance; iter = new ReplaceableContextEnumerator(); result = new StringBuilder(); - caseLocale = UCaseProps.GetCaseLocale(locale); + caseLocale = UCaseProperties.GetCaseLocale(locale); } /// @@ -94,7 +94,7 @@ protected override void HandleTransliterate(IReplaceable text, /* c mapped to itself, no change */ continue; } - else if (c <= UCaseProps.MaxStringLength) + else if (c <= UCaseProperties.MaxStringLength) { /* replace by the mapping string */ delta = iter.Replace(result.ToString()); diff --git a/src/ICU4N/Globalization/UCharacter.cs b/src/ICU4N/Globalization/UCharacter.cs index ca1da2af8..7cd3de7bd 100644 --- a/src/ICU4N/Globalization/UCharacter.cs +++ b/src/ICU4N/Globalization/UCharacter.cs @@ -3936,7 +3936,7 @@ public static bool IsUpper(string s, int index) // ICU4N specific overload to co // ICU4N TODO: API - to cover Char, add overload for (string, int) public static int ToLower(int ch) // ICU4N TODO: API - should this be ToLowerInvariant? Need to figure out the context-sensitive behavior and add overload if necessary. { - return UCaseProps.Instance.ToLower(ch); + return UCaseProperties.Instance.ToLower(ch); } /// @@ -3992,7 +3992,7 @@ public static string ConvertFromUtf32(int utf32) // ICU4N: Renamed from ToString // ICU4N TODO: API - to cover Char, add overload for (string, int) public static int ToTitleCase(int ch) { - return UCaseProps.Instance.ToTitle(ch); + return UCaseProperties.Instance.ToTitle(ch); } /// @@ -4018,7 +4018,7 @@ public static int ToTitleCase(int ch) // ICU4N TODO: API - to cover Char, add overload for (string, int) public static int ToUpper(int ch) // ICU4N TODO: API - should this be ToUpperInvariant? Need to figure out the context-sensitive behavior and add overload if necessary. { - return UCaseProps.Instance.ToUpper(ch); + return UCaseProperties.Instance.ToUpper(ch); } // ICU4N TODO: API - move functions from above not in System.Char to this section @@ -4980,7 +4980,7 @@ public static string ToTitleCase(string str, BreakIterator breakiter) // ICU4N T private static CaseLocale GetDefaultCaseLocale() { - return UCaseProps.GetCaseLocale(CultureInfo.CurrentCulture); + return UCaseProperties.GetCaseLocale(CultureInfo.CurrentCulture); } private static CaseLocale GetCaseLocale(CultureInfo locale) @@ -4989,7 +4989,7 @@ private static CaseLocale GetCaseLocale(CultureInfo locale) { locale = CultureInfo.CurrentCulture; } - return UCaseProps.GetCaseLocale(locale); + return UCaseProperties.GetCaseLocale(locale); } private static CaseLocale GetCaseLocale(ULocale locale) @@ -4998,7 +4998,7 @@ private static CaseLocale GetCaseLocale(ULocale locale) { locale = ULocale.GetDefault(); } - return UCaseProps.GetCaseLocale(locale); + return UCaseProperties.GetCaseLocale(locale); } /// @@ -5358,7 +5358,7 @@ public static string FoldCase(string str, bool defaultmapping) // ICU4N TODO: AP /// ICU 2.6 public static int FoldCase(int ch, FoldCase foldCase) { - return UCaseProps.Instance.Fold(ch, foldCase); + return UCaseProperties.Instance.Fold(ch, foldCase); } /// diff --git a/src/ICU4N/Impl/CaseMapImpl.cs b/src/ICU4N/Impl/CaseMapImpl.cs index d9b0d690a..77332995c 100644 --- a/src/ICU4N/Impl/CaseMapImpl.cs +++ b/src/ICU4N/Impl/CaseMapImpl.cs @@ -238,7 +238,7 @@ private static bool IsLNS(int c) int gc = UCharacterProperty.Instance.GetType(c); return ((1 << gc) & LNS) != 0 || (gc == UUnicodeCategory.ModifierLetter.ToInt32() && - UCaseProps.Instance.GetCaseType(c) != CaseType.None); + UCaseProperties.Instance.GetCaseType(c) != CaseType.None); } public static int AddTitleIteratorOption(int options, int newOption) diff --git a/src/ICU4N/Impl/CaseMapImplExtension.cs b/src/ICU4N/Impl/CaseMapImplExtension.cs index 0f484839f..2a46a7590 100644 --- a/src/ICU4N/Impl/CaseMapImplExtension.cs +++ b/src/ICU4N/Impl/CaseMapImplExtension.cs @@ -49,7 +49,7 @@ private static int AppendCodePoint(IAppendable a, int c) } /// - /// Appends a full case mapping result, see + /// Appends a full case mapping result, see /// /// private static void AppendResult(int result, StringBuilder dest, @@ -69,7 +69,7 @@ private static void AppendResult(int result, StringBuilder dest, } AppendCodePoint(dest, ~result); } - else if (result <= UCaseProps.MaxStringLength) + else if (result <= UCaseProperties.MaxStringLength) { // The mapping has already been appended to result. if (edits != null) @@ -89,7 +89,7 @@ private static void AppendResult(int result, StringBuilder dest, } /// - /// Appends a full case mapping result, see + /// Appends a full case mapping result, see /// /// private static void AppendResult(int result, IAppendable dest, @@ -109,7 +109,7 @@ private static void AppendResult(int result, IAppendable dest, } AppendCodePoint(dest, ~result); } - else if (result <= UCaseProps.MaxStringLength) + else if (result <= UCaseProperties.MaxStringLength) { // The mapping has already been appended to result. if (edits != null) @@ -362,7 +362,7 @@ private static void InternalToLower(CaseLocale caseLocale, int options, StringCo int c; while ((c = iter.NextCaseMapCP()) >= 0) { - c = UCaseProps.Instance.ToFullLower(c, iter, dest, caseLocale); + c = UCaseProperties.Instance.ToFullLower(c, iter, dest, caseLocale); AppendResult(c, dest, iter.CPLength, options, edits); } } @@ -373,7 +373,7 @@ private static void InternalToLower(CaseLocale caseLocale, int options, StringCo int c; while ((c = iter.NextCaseMapCP()) >= 0) { - c = UCaseProps.Instance.ToFullLower(c, iter, dest, caseLocale); + c = UCaseProperties.Instance.ToFullLower(c, iter, dest, caseLocale); AppendResult(c, dest, iter.CPLength, options, edits); } } @@ -723,7 +723,7 @@ public static StringBuilder ToUpper(CaseLocale caseLocale, int options, int c; while ((c = iter.NextCaseMapCP()) >= 0) { - c = UCaseProps.Instance.ToFullUpper(c, iter, dest, caseLocale); + c = UCaseProperties.Instance.ToFullUpper(c, iter, dest, caseLocale); AppendResult(c, dest, iter.CPLength, options, edits); } return dest; @@ -751,7 +751,7 @@ public static StringBuilder ToUpper(CaseLocale caseLocale, int options, int c; while ((c = iter.NextCaseMapCP()) >= 0) { - c = UCaseProps.Instance.ToFullUpper(c, iter, dest, caseLocale); + c = UCaseProperties.Instance.ToFullUpper(c, iter, dest, caseLocale); AppendResult(c, dest, iter.CPLength, options, edits); } return dest; @@ -779,7 +779,7 @@ public static StringBuilder ToUpper(CaseLocale caseLocale, int options, int c; while ((c = iter.NextCaseMapCP()) >= 0) { - c = UCaseProps.Instance.ToFullUpper(c, iter, dest, caseLocale); + c = UCaseProperties.Instance.ToFullUpper(c, iter, dest, caseLocale); AppendResult(c, dest, iter.CPLength, options, edits); } return dest; @@ -807,7 +807,7 @@ internal static StringBuilder ToUpper(CaseLocale caseLocale, int options, int c; while ((c = iter.NextCaseMapCP()) >= 0) { - c = UCaseProps.Instance.ToFullUpper(c, iter, dest, caseLocale); + c = UCaseProperties.Instance.ToFullUpper(c, iter, dest, caseLocale); AppendResult(c, dest, iter.CPLength, options, edits); } return dest; @@ -835,7 +835,7 @@ internal static T ToUpper(CaseLocale caseLocale, int options, int c; while ((c = iter.NextCaseMapCP()) >= 0) { - c = UCaseProps.Instance.ToFullUpper(c, iter, dest, caseLocale); + c = UCaseProperties.Instance.ToFullUpper(c, iter, dest, caseLocale); AppendResult(c, dest, iter.CPLength, options, edits); } return dest; @@ -863,7 +863,7 @@ internal static T ToUpper(CaseLocale caseLocale, int options, int c; while ((c = iter.NextCaseMapCP()) >= 0) { - c = UCaseProps.Instance.ToFullUpper(c, iter, dest, caseLocale); + c = UCaseProperties.Instance.ToFullUpper(c, iter, dest, caseLocale); AppendResult(c, dest, iter.CPLength, options, edits); } return dest; @@ -891,7 +891,7 @@ internal static T ToUpper(CaseLocale caseLocale, int options, int c; while ((c = iter.NextCaseMapCP()) >= 0) { - c = UCaseProps.Instance.ToFullUpper(c, iter, dest, caseLocale); + c = UCaseProperties.Instance.ToFullUpper(c, iter, dest, caseLocale); AppendResult(c, dest, iter.CPLength, options, edits); } return dest; @@ -919,7 +919,7 @@ internal static T ToUpper(CaseLocale caseLocale, int options, int c; while ((c = iter.NextCaseMapCP()) >= 0) { - c = UCaseProps.Instance.ToFullUpper(c, iter, dest, caseLocale); + c = UCaseProperties.Instance.ToFullUpper(c, iter, dest, caseLocale); AppendResult(c, dest, iter.CPLength, options, edits); } return dest; @@ -1079,7 +1079,7 @@ public static StringBuilder ToTitle( // or else stop with titleStart==titleLimit==index. bool toCased = (options & CaseMapImpl.TITLECASE_ADJUST_TO_CASED) != 0; while ((toCased ? - CaseType.None == UCaseProps.Instance.GetCaseType(c) : + CaseType.None == UCaseProperties.Instance.GetCaseType(c) : !CaseMapImpl.IsLNS(c)) && (c = iter.NextCaseMapCP()) >= 0) { } // If c<0 then we have only uncased characters in [prev..index[ @@ -1095,7 +1095,7 @@ public static StringBuilder ToTitle( { int titleLimit = iter.CPLimit; // titlecase c which is from [titleStart..titleLimit[ - c = UCaseProps.Instance.ToFullTitle(c, iter, dest, caseLocale); + c = UCaseProperties.Instance.ToFullTitle(c, iter, dest, caseLocale); AppendResult(c, dest, iter.CPLength, options, edits); // Special case Dutch IJ titlecasing @@ -1214,7 +1214,7 @@ public static StringBuilder ToTitle( // or else stop with titleStart==titleLimit==index. bool toCased = (options & CaseMapImpl.TITLECASE_ADJUST_TO_CASED) != 0; while ((toCased ? - CaseType.None == UCaseProps.Instance.GetCaseType(c) : + CaseType.None == UCaseProperties.Instance.GetCaseType(c) : !CaseMapImpl.IsLNS(c)) && (c = iter.NextCaseMapCP()) >= 0) { } // If c<0 then we have only uncased characters in [prev..index[ @@ -1230,7 +1230,7 @@ public static StringBuilder ToTitle( { int titleLimit = iter.CPLimit; // titlecase c which is from [titleStart..titleLimit[ - c = UCaseProps.Instance.ToFullTitle(c, iter, dest, caseLocale); + c = UCaseProperties.Instance.ToFullTitle(c, iter, dest, caseLocale); AppendResult(c, dest, iter.CPLength, options, edits); // Special case Dutch IJ titlecasing @@ -1349,7 +1349,7 @@ public static StringBuilder ToTitle( // or else stop with titleStart==titleLimit==index. bool toCased = (options & CaseMapImpl.TITLECASE_ADJUST_TO_CASED) != 0; while ((toCased ? - CaseType.None == UCaseProps.Instance.GetCaseType(c) : + CaseType.None == UCaseProperties.Instance.GetCaseType(c) : !CaseMapImpl.IsLNS(c)) && (c = iter.NextCaseMapCP()) >= 0) { } // If c<0 then we have only uncased characters in [prev..index[ @@ -1365,7 +1365,7 @@ public static StringBuilder ToTitle( { int titleLimit = iter.CPLimit; // titlecase c which is from [titleStart..titleLimit[ - c = UCaseProps.Instance.ToFullTitle(c, iter, dest, caseLocale); + c = UCaseProperties.Instance.ToFullTitle(c, iter, dest, caseLocale); AppendResult(c, dest, iter.CPLength, options, edits); // Special case Dutch IJ titlecasing @@ -1484,7 +1484,7 @@ internal static StringBuilder ToTitle( // or else stop with titleStart==titleLimit==index. bool toCased = (options & CaseMapImpl.TITLECASE_ADJUST_TO_CASED) != 0; while ((toCased ? - CaseType.None == UCaseProps.Instance.GetCaseType(c) : + CaseType.None == UCaseProperties.Instance.GetCaseType(c) : !CaseMapImpl.IsLNS(c)) && (c = iter.NextCaseMapCP()) >= 0) { } // If c<0 then we have only uncased characters in [prev..index[ @@ -1500,7 +1500,7 @@ internal static StringBuilder ToTitle( { int titleLimit = iter.CPLimit; // titlecase c which is from [titleStart..titleLimit[ - c = UCaseProps.Instance.ToFullTitle(c, iter, dest, caseLocale); + c = UCaseProperties.Instance.ToFullTitle(c, iter, dest, caseLocale); AppendResult(c, dest, iter.CPLength, options, edits); // Special case Dutch IJ titlecasing @@ -1619,7 +1619,7 @@ internal static T ToTitle( // or else stop with titleStart==titleLimit==index. bool toCased = (options & CaseMapImpl.TITLECASE_ADJUST_TO_CASED) != 0; while ((toCased ? - CaseType.None == UCaseProps.Instance.GetCaseType(c) : + CaseType.None == UCaseProperties.Instance.GetCaseType(c) : !CaseMapImpl.IsLNS(c)) && (c = iter.NextCaseMapCP()) >= 0) { } // If c<0 then we have only uncased characters in [prev..index[ @@ -1635,7 +1635,7 @@ internal static T ToTitle( { int titleLimit = iter.CPLimit; // titlecase c which is from [titleStart..titleLimit[ - c = UCaseProps.Instance.ToFullTitle(c, iter, dest, caseLocale); + c = UCaseProperties.Instance.ToFullTitle(c, iter, dest, caseLocale); AppendResult(c, dest, iter.CPLength, options, edits); // Special case Dutch IJ titlecasing @@ -1754,7 +1754,7 @@ internal static T ToTitle( // or else stop with titleStart==titleLimit==index. bool toCased = (options & CaseMapImpl.TITLECASE_ADJUST_TO_CASED) != 0; while ((toCased ? - CaseType.None == UCaseProps.Instance.GetCaseType(c) : + CaseType.None == UCaseProperties.Instance.GetCaseType(c) : !CaseMapImpl.IsLNS(c)) && (c = iter.NextCaseMapCP()) >= 0) { } // If c<0 then we have only uncased characters in [prev..index[ @@ -1770,7 +1770,7 @@ internal static T ToTitle( { int titleLimit = iter.CPLimit; // titlecase c which is from [titleStart..titleLimit[ - c = UCaseProps.Instance.ToFullTitle(c, iter, dest, caseLocale); + c = UCaseProperties.Instance.ToFullTitle(c, iter, dest, caseLocale); AppendResult(c, dest, iter.CPLength, options, edits); // Special case Dutch IJ titlecasing @@ -1889,7 +1889,7 @@ internal static T ToTitle( // or else stop with titleStart==titleLimit==index. bool toCased = (options & CaseMapImpl.TITLECASE_ADJUST_TO_CASED) != 0; while ((toCased ? - CaseType.None == UCaseProps.Instance.GetCaseType(c) : + CaseType.None == UCaseProperties.Instance.GetCaseType(c) : !CaseMapImpl.IsLNS(c)) && (c = iter.NextCaseMapCP()) >= 0) { } // If c<0 then we have only uncased characters in [prev..index[ @@ -1905,7 +1905,7 @@ internal static T ToTitle( { int titleLimit = iter.CPLimit; // titlecase c which is from [titleStart..titleLimit[ - c = UCaseProps.Instance.ToFullTitle(c, iter, dest, caseLocale); + c = UCaseProperties.Instance.ToFullTitle(c, iter, dest, caseLocale); AppendResult(c, dest, iter.CPLength, options, edits); // Special case Dutch IJ titlecasing @@ -2024,7 +2024,7 @@ internal static T ToTitle( // or else stop with titleStart==titleLimit==index. bool toCased = (options & CaseMapImpl.TITLECASE_ADJUST_TO_CASED) != 0; while ((toCased ? - CaseType.None == UCaseProps.Instance.GetCaseType(c) : + CaseType.None == UCaseProperties.Instance.GetCaseType(c) : !CaseMapImpl.IsLNS(c)) && (c = iter.NextCaseMapCP()) >= 0) { } // If c<0 then we have only uncased characters in [prev..index[ @@ -2040,7 +2040,7 @@ internal static T ToTitle( { int titleLimit = iter.CPLimit; // titlecase c which is from [titleStart..titleLimit[ - c = UCaseProps.Instance.ToFullTitle(c, iter, dest, caseLocale); + c = UCaseProperties.Instance.ToFullTitle(c, iter, dest, caseLocale); AppendResult(c, dest, iter.CPLength, options, edits); // Special case Dutch IJ titlecasing @@ -2201,7 +2201,7 @@ public static StringBuilder Fold(int options, int c = Character.CodePointAt(src, i); int cpLength = Character.CharCount(c); i += cpLength; - c = UCaseProps.Instance.ToFullFolding(c, dest, options); + c = UCaseProperties.Instance.ToFullFolding(c, dest, options); AppendResult(c, dest, cpLength, options, edits); } return dest; @@ -2227,7 +2227,7 @@ public static StringBuilder Fold(int options, int c = Character.CodePointAt(src, i); int cpLength = Character.CharCount(c); i += cpLength; - c = UCaseProps.Instance.ToFullFolding(c, dest, options); + c = UCaseProperties.Instance.ToFullFolding(c, dest, options); AppendResult(c, dest, cpLength, options, edits); } return dest; @@ -2253,7 +2253,7 @@ public static StringBuilder Fold(int options, int c = Character.CodePointAt(src, i); int cpLength = Character.CharCount(c); i += cpLength; - c = UCaseProps.Instance.ToFullFolding(c, dest, options); + c = UCaseProperties.Instance.ToFullFolding(c, dest, options); AppendResult(c, dest, cpLength, options, edits); } return dest; @@ -2279,7 +2279,7 @@ internal static StringBuilder Fold(int options, int c = Character.CodePointAt(src, i); int cpLength = Character.CharCount(c); i += cpLength; - c = UCaseProps.Instance.ToFullFolding(c, dest, options); + c = UCaseProperties.Instance.ToFullFolding(c, dest, options); AppendResult(c, dest, cpLength, options, edits); } return dest; @@ -2305,7 +2305,7 @@ internal static T Fold(int options, int c = Character.CodePointAt(src, i); int cpLength = Character.CharCount(c); i += cpLength; - c = UCaseProps.Instance.ToFullFolding(c, dest, options); + c = UCaseProperties.Instance.ToFullFolding(c, dest, options); AppendResult(c, dest, cpLength, options, edits); } return dest; @@ -2331,7 +2331,7 @@ internal static T Fold(int options, int c = Character.CodePointAt(src, i); int cpLength = Character.CharCount(c); i += cpLength; - c = UCaseProps.Instance.ToFullFolding(c, dest, options); + c = UCaseProperties.Instance.ToFullFolding(c, dest, options); AppendResult(c, dest, cpLength, options, edits); } return dest; @@ -2357,7 +2357,7 @@ internal static T Fold(int options, int c = Character.CodePointAt(src, i); int cpLength = Character.CharCount(c); i += cpLength; - c = UCaseProps.Instance.ToFullFolding(c, dest, options); + c = UCaseProperties.Instance.ToFullFolding(c, dest, options); AppendResult(c, dest, cpLength, options, edits); } return dest; @@ -2383,7 +2383,7 @@ internal static T Fold(int options, int c = Character.CodePointAt(src, i); int cpLength = Character.CharCount(c); i += cpLength; - c = UCaseProps.Instance.ToFullFolding(c, dest, options); + c = UCaseProperties.Instance.ToFullFolding(c, dest, options); AppendResult(c, dest, cpLength, options, edits); } return dest; @@ -2403,7 +2403,7 @@ private static bool IsFollowedByCasedLetter(string s, int i) { int c = Character.CodePointAt(s, i); // ICU4N: Simplfied version of GetTypeOrIgnorable - if (UCaseProps.Instance.IsCaseIgnorable(c, out CaseType type)) + if (UCaseProperties.Instance.IsCaseIgnorable(c, out CaseType type)) { // Case-ignorable, continue with the loop. i += Character.CharCount(c); @@ -2426,7 +2426,7 @@ private static bool IsFollowedByCasedLetter(StringBuilder s, int i) { int c = Character.CodePointAt(s, i); // ICU4N: Simplfied version of GetTypeOrIgnorable - if (UCaseProps.Instance.IsCaseIgnorable(c, out CaseType type)) + if (UCaseProperties.Instance.IsCaseIgnorable(c, out CaseType type)) { // Case-ignorable, continue with the loop. i += Character.CharCount(c); @@ -2449,7 +2449,7 @@ private static bool IsFollowedByCasedLetter(char[] s, int i) { int c = Character.CodePointAt(s, i); // ICU4N: Simplfied version of GetTypeOrIgnorable - if (UCaseProps.Instance.IsCaseIgnorable(c, out CaseType type)) + if (UCaseProperties.Instance.IsCaseIgnorable(c, out CaseType type)) { // Case-ignorable, continue with the loop. i += Character.CharCount(c); @@ -2472,7 +2472,7 @@ private static bool IsFollowedByCasedLetter(ICharSequence s, int i) { int c = Character.CodePointAt(s, i); // ICU4N: Simplfied version of GetTypeOrIgnorable - if (UCaseProps.Instance.IsCaseIgnorable(c, out CaseType type)) + if (UCaseProperties.Instance.IsCaseIgnorable(c, out CaseType type)) { // Case-ignorable, continue with the loop. i += Character.CharCount(c); @@ -2509,7 +2509,7 @@ public static StringBuilder ToUpper(int options, int nextIndex = i + Character.CharCount(c); int nextState = 0; // ICU4N: Simplfied version of GetTypeOrIgnorable - if (UCaseProps.Instance.IsCaseIgnorable(c, out CaseType type)) + if (UCaseProperties.Instance.IsCaseIgnorable(c, out CaseType type)) { // c is case-ignorable nextState |= (state & AFTER_CASED); @@ -2656,7 +2656,7 @@ public static StringBuilder ToUpper(int options, } else { - c = UCaseProps.Instance.ToFullUpper(c, null, dest, CaseLocale.Greek); + c = UCaseProperties.Instance.ToFullUpper(c, null, dest, CaseLocale.Greek); AppendResult(c, dest, nextIndex - i, options, edits); } i = nextIndex; @@ -2685,7 +2685,7 @@ public static StringBuilder ToUpper(int options, int nextIndex = i + Character.CharCount(c); int nextState = 0; // ICU4N: Simplfied version of GetTypeOrIgnorable - if (UCaseProps.Instance.IsCaseIgnorable(c, out CaseType type)) + if (UCaseProperties.Instance.IsCaseIgnorable(c, out CaseType type)) { // c is case-ignorable nextState |= (state & AFTER_CASED); @@ -2832,7 +2832,7 @@ public static StringBuilder ToUpper(int options, } else { - c = UCaseProps.Instance.ToFullUpper(c, null, dest, CaseLocale.Greek); + c = UCaseProperties.Instance.ToFullUpper(c, null, dest, CaseLocale.Greek); AppendResult(c, dest, nextIndex - i, options, edits); } i = nextIndex; @@ -2861,7 +2861,7 @@ public static StringBuilder ToUpper(int options, int nextIndex = i + Character.CharCount(c); int nextState = 0; // ICU4N: Simplfied version of GetTypeOrIgnorable - if (UCaseProps.Instance.IsCaseIgnorable(c, out CaseType type)) + if (UCaseProperties.Instance.IsCaseIgnorable(c, out CaseType type)) { // c is case-ignorable nextState |= (state & AFTER_CASED); @@ -3008,7 +3008,7 @@ public static StringBuilder ToUpper(int options, } else { - c = UCaseProps.Instance.ToFullUpper(c, null, dest, CaseLocale.Greek); + c = UCaseProperties.Instance.ToFullUpper(c, null, dest, CaseLocale.Greek); AppendResult(c, dest, nextIndex - i, options, edits); } i = nextIndex; @@ -3037,7 +3037,7 @@ internal static StringBuilder ToUpper(int options, int nextIndex = i + Character.CharCount(c); int nextState = 0; // ICU4N: Simplfied version of GetTypeOrIgnorable - if (UCaseProps.Instance.IsCaseIgnorable(c, out CaseType type)) + if (UCaseProperties.Instance.IsCaseIgnorable(c, out CaseType type)) { // c is case-ignorable nextState |= (state & AFTER_CASED); @@ -3184,7 +3184,7 @@ internal static StringBuilder ToUpper(int options, } else { - c = UCaseProps.Instance.ToFullUpper(c, null, dest, CaseLocale.Greek); + c = UCaseProperties.Instance.ToFullUpper(c, null, dest, CaseLocale.Greek); AppendResult(c, dest, nextIndex - i, options, edits); } i = nextIndex; @@ -3213,7 +3213,7 @@ internal static T ToUpper(int options, int nextIndex = i + Character.CharCount(c); int nextState = 0; // ICU4N: Simplfied version of GetTypeOrIgnorable - if (UCaseProps.Instance.IsCaseIgnorable(c, out CaseType type)) + if (UCaseProperties.Instance.IsCaseIgnorable(c, out CaseType type)) { // c is case-ignorable nextState |= (state & AFTER_CASED); @@ -3360,7 +3360,7 @@ internal static T ToUpper(int options, } else { - c = UCaseProps.Instance.ToFullUpper(c, null, dest, CaseLocale.Greek); + c = UCaseProperties.Instance.ToFullUpper(c, null, dest, CaseLocale.Greek); AppendResult(c, dest, nextIndex - i, options, edits); } i = nextIndex; @@ -3389,7 +3389,7 @@ internal static T ToUpper(int options, int nextIndex = i + Character.CharCount(c); int nextState = 0; // ICU4N: Simplfied version of GetTypeOrIgnorable - if (UCaseProps.Instance.IsCaseIgnorable(c, out CaseType type)) + if (UCaseProperties.Instance.IsCaseIgnorable(c, out CaseType type)) { // c is case-ignorable nextState |= (state & AFTER_CASED); @@ -3536,7 +3536,7 @@ internal static T ToUpper(int options, } else { - c = UCaseProps.Instance.ToFullUpper(c, null, dest, CaseLocale.Greek); + c = UCaseProperties.Instance.ToFullUpper(c, null, dest, CaseLocale.Greek); AppendResult(c, dest, nextIndex - i, options, edits); } i = nextIndex; @@ -3565,7 +3565,7 @@ internal static T ToUpper(int options, int nextIndex = i + Character.CharCount(c); int nextState = 0; // ICU4N: Simplfied version of GetTypeOrIgnorable - if (UCaseProps.Instance.IsCaseIgnorable(c, out CaseType type)) + if (UCaseProperties.Instance.IsCaseIgnorable(c, out CaseType type)) { // c is case-ignorable nextState |= (state & AFTER_CASED); @@ -3712,7 +3712,7 @@ internal static T ToUpper(int options, } else { - c = UCaseProps.Instance.ToFullUpper(c, null, dest, CaseLocale.Greek); + c = UCaseProperties.Instance.ToFullUpper(c, null, dest, CaseLocale.Greek); AppendResult(c, dest, nextIndex - i, options, edits); } i = nextIndex; @@ -3741,7 +3741,7 @@ internal static T ToUpper(int options, int nextIndex = i + Character.CharCount(c); int nextState = 0; // ICU4N: Simplfied version of GetTypeOrIgnorable - if (UCaseProps.Instance.IsCaseIgnorable(c, out CaseType type)) + if (UCaseProperties.Instance.IsCaseIgnorable(c, out CaseType type)) { // c is case-ignorable nextState |= (state & AFTER_CASED); @@ -3888,7 +3888,7 @@ internal static T ToUpper(int options, } else { - c = UCaseProps.Instance.ToFullUpper(c, null, dest, CaseLocale.Greek); + c = UCaseProperties.Instance.ToFullUpper(c, null, dest, CaseLocale.Greek); AppendResult(c, dest, nextIndex - i, options, edits); } i = nextIndex; diff --git a/src/ICU4N/Impl/CaseMapImplExtension.tt b/src/ICU4N/Impl/CaseMapImplExtension.tt index 78941cb52..cb9aac332 100644 --- a/src/ICU4N/Impl/CaseMapImplExtension.tt +++ b/src/ICU4N/Impl/CaseMapImplExtension.tt @@ -56,7 +56,7 @@ namespace ICU4N.Impl <# foreach (var appendable in appendables) { #> /// - /// Appends a full case mapping result, see + /// Appends a full case mapping result, see /// /// private static void AppendResult(int result, <#=appendable#> dest, @@ -76,7 +76,7 @@ namespace ICU4N.Impl } AppendCodePoint(dest, ~result); } - else if (result <= UCaseProps.MaxStringLength) + else if (result <= UCaseProperties.MaxStringLength) { // The mapping has already been appended to result. if (edits != null) @@ -153,7 +153,7 @@ namespace ICU4N.Impl int c; while ((c = iter.NextCaseMapCP()) >= 0) { - c = UCaseProps.Instance.ToFullLower(c, iter, dest, caseLocale); + c = UCaseProperties.Instance.ToFullLower(c, iter, dest, caseLocale); AppendResult(c, dest, iter.CPLength, options, edits); } } @@ -259,7 +259,7 @@ namespace ICU4N.Impl int c; while ((c = iter.NextCaseMapCP()) >= 0) { - c = UCaseProps.Instance.ToFullUpper(c, iter, dest, caseLocale); + c = UCaseProperties.Instance.ToFullUpper(c, iter, dest, caseLocale); AppendResult(c, dest, iter.CPLength, options, edits); } return dest; @@ -362,7 +362,7 @@ namespace ICU4N.Impl // or else stop with titleStart==titleLimit==index. bool toCased = (options & CaseMapImpl.TITLECASE_ADJUST_TO_CASED) != 0; while ((toCased ? - CaseType.None == UCaseProps.Instance.GetCaseType(c) : + CaseType.None == UCaseProperties.Instance.GetCaseType(c) : !CaseMapImpl.IsLNS(c)) && (c = iter.NextCaseMapCP()) >= 0) { } // If c<0 then we have only uncased characters in [prev..index[ @@ -378,7 +378,7 @@ namespace ICU4N.Impl { int titleLimit = iter.CPLimit; // titlecase c which is from [titleStart..titleLimit[ - c = UCaseProps.Instance.ToFullTitle(c, iter, dest, caseLocale); + c = UCaseProperties.Instance.ToFullTitle(c, iter, dest, caseLocale); AppendResult(c, dest, iter.CPLength, options, edits); // Special case Dutch IJ titlecasing @@ -487,7 +487,7 @@ namespace ICU4N.Impl int c = Character.CodePointAt(src, i); int cpLength = Character.CharCount(c); i += cpLength; - c = UCaseProps.Instance.ToFullFolding(c, dest, options); + c = UCaseProperties.Instance.ToFullFolding(c, dest, options); AppendResult(c, dest, cpLength, options, edits); } return dest; @@ -510,7 +510,7 @@ namespace ICU4N.Impl { int c = Character.CodePointAt(s, i); // ICU4N: Simplfied version of GetTypeOrIgnorable - if (UCaseProps.Instance.IsCaseIgnorable(c, out CaseType type)) + if (UCaseProperties.Instance.IsCaseIgnorable(c, out CaseType type)) { // Case-ignorable, continue with the loop. i += Character.CharCount(c); @@ -555,7 +555,7 @@ namespace ICU4N.Impl int nextIndex = i + Character.CharCount(c); int nextState = 0; // ICU4N: Simplfied version of GetTypeOrIgnorable - if (UCaseProps.Instance.IsCaseIgnorable(c, out CaseType type)) + if (UCaseProperties.Instance.IsCaseIgnorable(c, out CaseType type)) { // c is case-ignorable nextState |= (state & AFTER_CASED); @@ -702,7 +702,7 @@ namespace ICU4N.Impl } else { - c = UCaseProps.Instance.ToFullUpper(c, null, dest, CaseLocale.Greek); + c = UCaseProperties.Instance.ToFullUpper(c, null, dest, CaseLocale.Greek); AppendResult(c, dest, nextIndex - i, options, edits); } i = nextIndex; diff --git a/src/ICU4N/Impl/UCaseProps.cs b/src/ICU4N/Impl/UCaseProps.cs index 0e5e82610..80df5da74 100644 --- a/src/ICU4N/Impl/UCaseProps.cs +++ b/src/ICU4N/Impl/UCaseProps.cs @@ -51,8 +51,8 @@ public interface ICasePropertiesContextEnumerator // ICU4N specific - renamed fr } /// - /// Casing locale types for , - /// and . + /// Casing locale types for , + /// and . /// public enum CaseLocale { @@ -67,8 +67,8 @@ public enum CaseLocale /// /// Case type for non-case-ignorable properties. /// - /// - /// + /// + /// public enum CaseType { None = 0, @@ -80,7 +80,7 @@ public enum CaseType /// /// Dot type for case properties. /// - /// + /// [SuppressMessage("Microsoft.Design", "CA1027", Justification = "Enum values cannot be combined")] public enum DotType { @@ -96,12 +96,12 @@ public enum DotType /// /// Markus W. Scherer /// 2005jan29 - public sealed partial class UCaseProps + public sealed partial class UCaseProperties { // constructors etc. --------------------------------------------------- *** // port of ucase_openProps() - private UCaseProps() + private UCaseProperties() { ByteBuffer bytes = ICUBinary.GetRequiredData(DATA_FILE_NAME); ReadData(bytes); @@ -1315,14 +1315,14 @@ private static int GetDelta(int props) /// /// Public singleton instance. /// - public static UCaseProps Instance { get; private set; } = LoadSingletonInstance(); + public static UCaseProperties Instance { get; private set; } = LoadSingletonInstance(); // ICU4N: Avoid static constructors - private static UCaseProps LoadSingletonInstance() + private static UCaseProperties LoadSingletonInstance() { try { - return new UCaseProps(); + return new UCaseProperties(); } catch (IOException e) { diff --git a/src/ICU4N/Impl/UCasePropsExtension.cs b/src/ICU4N/Impl/UCasePropsExtension.cs index c9ff0e12f..5926db250 100644 --- a/src/ICU4N/Impl/UCasePropsExtension.cs +++ b/src/ICU4N/Impl/UCasePropsExtension.cs @@ -14,7 +14,7 @@ namespace ICU4N.Impl { - public sealed partial class UCaseProps + public sealed partial class UCaseProperties { /// diff --git a/src/ICU4N/Impl/UCasePropsExtension.tt b/src/ICU4N/Impl/UCasePropsExtension.tt index c030d74d4..855fdea74 100644 --- a/src/ICU4N/Impl/UCasePropsExtension.tt +++ b/src/ICU4N/Impl/UCasePropsExtension.tt @@ -33,7 +33,7 @@ using System.Text; namespace ICU4N.Impl { - public sealed partial class UCaseProps + public sealed partial class UCaseProperties { <# foreach (var appendable in appendables) { #> diff --git a/src/ICU4N/Impl/UCharacterProperty.cs b/src/ICU4N/Impl/UCharacterProperty.cs index 276ce376f..bd6024b79 100644 --- a/src/ICU4N/Impl/UCharacterProperty.cs +++ b/src/ICU4N/Impl/UCharacterProperty.cs @@ -226,7 +226,7 @@ internal CaseBinaryProperty(UCharacterProperty outerInstance, int which) } internal override bool Contains(int c) { - return UCaseProps.Instance.HasBinaryProperty(c, (UProperty)which); + return UCaseProperties.Instance.HasBinaryProperty(c, (UProperty)which); } } @@ -398,9 +398,9 @@ private void Init() if (c >= 0) { /* single code point */ - UCaseProps csp = UCaseProps.Instance; - UCaseProps.DummyStringBuilder.Length = 0; - return csp.ToFullFolding(c, UCaseProps.DummyStringBuilder, + UCaseProperties csp = UCaseProperties.Instance; + UCaseProperties.DummyStringBuilder.Length = 0; + return csp.ToFullFolding(c, UCaseProperties.DummyStringBuilder, UChar.FoldCaseDefault) >= 0; } else diff --git a/src/ICU4N/Text/CaseMap.cs b/src/ICU4N/Text/CaseMap.cs index e5ac849c6..46d73a36a 100644 --- a/src/ICU4N/Text/CaseMap.cs +++ b/src/ICU4N/Text/CaseMap.cs @@ -26,7 +26,7 @@ internal static CaseLocale GetCaseLocale(CultureInfo locale) { locale = CultureInfo.CurrentCulture; } - return UCaseProps.GetCaseLocale(locale); + return UCaseProperties.GetCaseLocale(locale); } /// diff --git a/src/ICU4N/Text/Normalizer.cs b/src/ICU4N/Text/Normalizer.cs index a237390a2..3cae5c143 100644 --- a/src/ICU4N/Text/Normalizer.cs +++ b/src/ICU4N/Text/Normalizer.cs @@ -2245,7 +2245,7 @@ public static string GetFC_NFKC_Closure(int c) // case folding and NFKC.) // For the derivation, see Unicode's DerivedNormalizationProps.txt. Normalizer2 nfkc = NFKCModeImpl.Instance.Normalizer2; - UCaseProps csp = UCaseProps.Instance; + UCaseProperties csp = UCaseProperties.Instance; // first: b = NFKC(Fold(a)) StringBuilder folded = new StringBuilder(); int folded1Length = csp.ToFullFolding(c, folded, 0); @@ -2260,7 +2260,7 @@ public static string GetFC_NFKC_Closure(int c) } else { - if (folded1Length > UCaseProps.MaxStringLength) + if (folded1Length > UCaseProperties.MaxStringLength) { folded.AppendCodePoint(folded1Length); } @@ -2983,7 +2983,7 @@ private static CmpEquivLevel[] CreateCmpEquivLevelStack() internal static int CmpEquivFold(ICharSequence cs1, ICharSequence cs2, int options) { Normalizer2Impl nfcImpl; - UCaseProps csp; + UCaseProperties csp; /* current-level start/limit - s1/s2 as current */ int s1, s2, limit1, limit2; @@ -3025,7 +3025,7 @@ internal static int CmpEquivFold(ICharSequence cs1, ICharSequence cs2, int optio } if ((options & COMPARE_IGNORE_CASE) != 0) { - csp = UCaseProps.Instance; + csp = UCaseProperties.Instance; fold1 = new StringBuilder(); fold2 = new StringBuilder(); } @@ -3222,7 +3222,7 @@ internal static int CmpEquivFold(ICharSequence cs1, ICharSequence cs2, int optio /* copy the folding result to fold1[] */ /* Java: the buffer was probably not empty, remove the old contents */ - if (length <= UCaseProps.MaxStringLength) + if (length <= UCaseProperties.MaxStringLength) { fold1.Delete(0, fold1.Length - length); } @@ -3279,7 +3279,7 @@ internal static int CmpEquivFold(ICharSequence cs1, ICharSequence cs2, int optio /* copy the folding result to fold2[] */ /* Java: the buffer was probably not empty, remove the old contents */ - if (length <= UCaseProps.MaxStringLength) + if (length <= UCaseProperties.MaxStringLength) { fold2.Delete(0, fold2.Length - length); } diff --git a/src/ICU4N/Text/UnicodeSet.cs b/src/ICU4N/Text/UnicodeSet.cs index b694dfb07..3c3cd1580 100644 --- a/src/ICU4N/Text/UnicodeSet.cs +++ b/src/ICU4N/Text/UnicodeSet.cs @@ -3332,7 +3332,7 @@ private static UnicodeSet GetInclusions(int src) break; case UCharacterProperty.SRC_CASE_AND_NORM: Norm2AllModes.GetNFCInstance().Impl.AddPropertyStarts(incl); - UCaseProps.Instance.AddPropertyStarts(incl); + UCaseProperties.Instance.AddPropertyStarts(incl); break; case UCharacterProperty.SRC_NFC: Norm2AllModes.GetNFCInstance().Impl.AddPropertyStarts(incl); @@ -3347,7 +3347,7 @@ private static UnicodeSet GetInclusions(int src) Norm2AllModes.GetNFCInstance().Impl.AddCanonIterPropertyStarts(incl); break; case UCharacterProperty.SRC_CASE: - UCaseProps.Instance.AddPropertyStarts(incl); + UCaseProperties.Instance.AddPropertyStarts(incl); break; case UCharacterProperty.SRC_BIDI: UBiDiProps.Instance.AddPropertyStarts(incl); @@ -3978,7 +3978,7 @@ private static void AddCaseMapping(UnicodeSet set, int result, StringBuilder ful { if (result >= 0) { - if (result > UCaseProps.MaxStringLength) + if (result > UCaseProperties.MaxStringLength) { // add a single-code point case mapping set.Add(result); @@ -4030,7 +4030,7 @@ public virtual UnicodeSet CloseOver(PatternOptions attribute) CheckFrozen(); if ((attribute & (Case | AddCaseMappings)) != 0) { - UCaseProps csp = UCaseProps.Instance; + UCaseProperties csp = UCaseProperties.Instance; UnicodeSet foldSet = new UnicodeSet(this); ULocale root = ULocale.ROOT;