Skip to content

Commit

Permalink
Fix warning
Browse files Browse the repository at this point in the history
  • Loading branch information
georg-jung committed Sep 17, 2023
1 parent 33abc96 commit 500f839
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/FastBertTokenizer/PreTokenizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ private static bool IsChineseCharacter(char cp)
// like all of the other languages.
#pragma warning disable SA1025 // Code should not contain multiple whitespace in a row
#pragma warning disable S2198 // Comparison to this constant is useless; the constant is outside the range of type 'char'. They are not useless, the rule is just wrong.
#pragma warning disable SA1108 // BlockStatementsMustNotContainEmbeddedComments. Better readable here.
if (
(cp >= 0x4E00 && cp <= 0x9FFF) // CJK Unified Ideographs
|| (cp >= 0x3400 && cp <= 0x4DBF) // CJK Unified Ideographs Extension A
Expand All @@ -147,10 +148,11 @@ private static bool IsChineseCharacter(char cp)
|| (cp >= 0x2B740 && cp <= 0x2B81F) // CJK Unified Ideographs Extension D
|| (cp >= 0x2B820 && cp <= 0x2CEAF) // CJK Unified Ideographs Extension E
|| (cp >= 0xF900 && cp <= 0xFAFF) // CJK Compatibility Ideographs
|| (cp >= 0x2F800 && cp <= 0x2FA1F)) // CJK Compatibility Ideographs Supplement
|| (cp >= 0x2F800 && cp <= 0x2FA1F)) // CJK Compatibility Ideographs Supplement
{
return true;
}
#pragma warning restore SA1108 // BlockStatementsMustNotContainEmbeddedComments
#pragma warning restore S2198 // Comparison to this constant is useless; the constant is outside the range of type 'char'.
#pragma warning restore SA1025 // Code should not contain multiple whitespace in a row

Expand Down

0 comments on commit 500f839

Please sign in to comment.