-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* target netstandard2.0 * update the codebase * add a parameter to handle empty * install .net6
- Loading branch information
1 parent
970b165
commit dad8bc3
Showing
31 changed files
with
1,304 additions
and
1,325 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: nuget | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
time: "00:00" | ||
open-pull-requests-limit: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,35 @@ | ||
/* | ||
* Copyright © 2021 MyNihongo | ||
* Copyright © 2023 MyNihongo | ||
*/ | ||
|
||
using static MyNihongo.KanaDetector.Resources.Constants; | ||
namespace MyNihongo.KanaDetector; | ||
|
||
namespace MyNihongo.KanaDetector.Extensions | ||
public static class CharExtensions | ||
{ | ||
public static class CharExtensions | ||
{ | ||
public static bool IsHiragana(this char @this) => | ||
@this is >= Kana.HiraganaStart and <= Kana.HiraganaEnd; | ||
public static bool IsHiragana(this char @this) => | ||
@this is >= Kana.HiraganaStart and <= Kana.HiraganaEnd; | ||
|
||
public static bool IsKatakana(this char @this) => | ||
@this is >= Kana.KatakanaStart and <= Kana.KatakanaEnd; | ||
public static bool IsKatakana(this char @this) => | ||
@this is >= Kana.KatakanaStart and <= Kana.KatakanaEnd; | ||
|
||
public static bool IsKana(this char @this) => | ||
@this.IsHiragana() || @this.IsKatakana(); | ||
public static bool IsKana(this char @this) => | ||
@this.IsHiragana() || @this.IsKatakana(); | ||
|
||
public static bool IsKanji(this char @this) => | ||
@this is | ||
>= Kanji.Start and <= Kanji.End or | ||
>= Kanji.RareStart and <= Kanji.RareEnd or | ||
Kanji.IterationMark; | ||
public static bool IsKanji(this char @this) => | ||
@this is | ||
>= Kanji.Start and <= Kanji.End or | ||
>= Kanji.RareStart and <= Kanji.RareEnd or | ||
Kanji.IterationMark; | ||
|
||
public static bool IsKanaOrKanji(this char @this) => | ||
@this.IsHiragana() || @this.IsKatakana() || @this.IsKanji(); | ||
public static bool IsKanaOrKanji(this char @this) => | ||
@this.IsHiragana() || @this.IsKatakana() || @this.IsKanji(); | ||
|
||
public static bool IsRomaji(this char @this) => | ||
@this | ||
is >= Romaji.EnglishStart and <= Romaji.EnglishEnd or | ||
Romaji.Hepbun.CapitalA or Romaji.Hepbun.SmallA or | ||
Romaji.Hepbun.CapitalI or Romaji.Hepbun.SmallI or | ||
Romaji.Hepbun.CapitalU or Romaji.Hepbun.SmallU or | ||
Romaji.Hepbun.CapitalE or Romaji.Hepbun.SmallE or | ||
Romaji.Hepbun.CapitalO or Romaji.Hepbun.SmallO; | ||
} | ||
public static bool IsRomaji(this char @this) => | ||
@this | ||
is >= Romaji.EnglishStart and <= Romaji.EnglishEnd or | ||
Romaji.Hepbun.CapitalA or Romaji.Hepbun.SmallA or | ||
Romaji.Hepbun.CapitalI or Romaji.Hepbun.SmallI or | ||
Romaji.Hepbun.CapitalU or Romaji.Hepbun.SmallU or | ||
Romaji.Hepbun.CapitalE or Romaji.Hepbun.SmallE or | ||
Romaji.Hepbun.CapitalO or Romaji.Hepbun.SmallO; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,161 +1,160 @@ | ||
/* | ||
* Copyright © 2021 MyNihongo | ||
* Copyright © 2023 MyNihongo | ||
*/ | ||
|
||
namespace MyNihongo.KanaDetector.Extensions | ||
namespace MyNihongo.KanaDetector; | ||
|
||
public static class StringExtensions | ||
{ | ||
public static class StringExtensions | ||
#region Is methods | ||
|
||
public static bool IsHiragana(this string @this, bool whenEmpty = false) | ||
{ | ||
#region Is methods | ||
if (string.IsNullOrEmpty(@this)) | ||
return whenEmpty; | ||
|
||
public static bool IsHiragana(this string @this) | ||
{ | ||
if (string.IsNullOrEmpty(@this)) | ||
for (var i = 0; i < @this.Length; i++) | ||
if (!@this[i].IsHiragana()) | ||
return false; | ||
|
||
for (var i = 0; i < @this.Length; i++) | ||
if (!@this[i].IsHiragana()) | ||
return false; | ||
return true; | ||
} | ||
|
||
return true; | ||
} | ||
public static bool IsKatakana(this string @this, bool whenEmpty = false) | ||
{ | ||
if (string.IsNullOrEmpty(@this)) | ||
return whenEmpty; | ||
|
||
public static bool IsKatakana(this string @this) | ||
{ | ||
if (string.IsNullOrEmpty(@this)) | ||
for (var i = 0; i < @this.Length; i++) | ||
if (!@this[i].IsKatakana()) | ||
return false; | ||
|
||
for (var i = 0; i < @this.Length; i++) | ||
if (!@this[i].IsKatakana()) | ||
return false; | ||
return true; | ||
} | ||
|
||
return true; | ||
} | ||
public static bool IsKana(this string @this, bool whenEmpty = false) | ||
{ | ||
if (string.IsNullOrEmpty(@this)) | ||
return whenEmpty; | ||
|
||
public static bool IsKana(this string @this) | ||
{ | ||
if (string.IsNullOrEmpty(@this)) | ||
for (var i = 0; i < @this.Length; i++) | ||
if (!@this[i].IsKana()) | ||
return false; | ||
|
||
for (var i = 0; i < @this.Length; i++) | ||
if (!@this[i].IsKana()) | ||
return false; | ||
return true; | ||
} | ||
|
||
return true; | ||
} | ||
public static bool IsKanji(this string @this, bool whenEmpty = false) | ||
{ | ||
if (string.IsNullOrEmpty(@this)) | ||
return whenEmpty; | ||
|
||
public static bool IsKanji(this string @this) | ||
{ | ||
if (string.IsNullOrEmpty(@this)) | ||
for (var i = 0; i < @this.Length; i++) | ||
if (!@this[i].IsKanji()) | ||
return false; | ||
|
||
for (var i = 0; i < @this.Length; i++) | ||
if (!@this[i].IsKanji()) | ||
return false; | ||
return true; | ||
} | ||
|
||
return true; | ||
} | ||
public static bool IsKanaOrKanji(this string @this, bool whenEmpty = false) | ||
{ | ||
if (string.IsNullOrEmpty(@this)) | ||
return whenEmpty; | ||
|
||
public static bool IsKanaOrKanji(this string @this) | ||
{ | ||
if (string.IsNullOrEmpty(@this)) | ||
for (var i = 0; i < @this.Length; i++) | ||
if (!@this[i].IsKanaOrKanji()) | ||
return false; | ||
|
||
for (var i = 0; i < @this.Length; i++) | ||
if (!@this[i].IsKanaOrKanji()) | ||
return false; | ||
return true; | ||
} | ||
|
||
return true; | ||
} | ||
public static bool IsRomaji(this string @this, bool whenEmpty = false) | ||
{ | ||
if (string.IsNullOrEmpty(@this)) | ||
return whenEmpty; | ||
|
||
public static bool IsRomaji(this string @this) | ||
{ | ||
if (string.IsNullOrEmpty(@this)) | ||
for (var i = 0; i < @this.Length; i++) | ||
if (!@this[i].IsRomaji()) | ||
return false; | ||
|
||
for (var i = 0; i < @this.Length; i++) | ||
if (!@this[i].IsRomaji()) | ||
return false; | ||
|
||
return true; | ||
} | ||
|
||
#endregion | ||
|
||
#region Has methods | ||
return true; | ||
} | ||
|
||
public static bool HasHiragana(this string @this) | ||
{ | ||
if (string.IsNullOrEmpty(@this)) | ||
return false; | ||
#endregion | ||
|
||
for (var i = 0; i < @this.Length; i++) | ||
if (@this[i].IsHiragana()) | ||
return true; | ||
#region Has methods | ||
|
||
public static bool HasHiragana(this string @this) | ||
{ | ||
if (string.IsNullOrEmpty(@this)) | ||
return false; | ||
} | ||
|
||
public static bool HasKatakana(this string @this) | ||
{ | ||
if (string.IsNullOrEmpty(@this)) | ||
return false; | ||
for (var i = 0; i < @this.Length; i++) | ||
if (@this[i].IsHiragana()) | ||
return true; | ||
|
||
for (var i = 0; i < @this.Length; i++) | ||
if (@this[i].IsKatakana()) | ||
return true; | ||
return false; | ||
} | ||
|
||
public static bool HasKatakana(this string @this) | ||
{ | ||
if (string.IsNullOrEmpty(@this)) | ||
return false; | ||
} | ||
|
||
public static bool HasKana(this string @this) | ||
{ | ||
if (string.IsNullOrEmpty(@this)) | ||
return false; | ||
for (var i = 0; i < @this.Length; i++) | ||
if (@this[i].IsKatakana()) | ||
return true; | ||
|
||
for (var i = 0; i < @this.Length; i++) | ||
if (@this[i].IsKana()) | ||
return true; | ||
return false; | ||
} | ||
|
||
public static bool HasKana(this string @this) | ||
{ | ||
if (string.IsNullOrEmpty(@this)) | ||
return false; | ||
} | ||
|
||
public static bool HasKanji(this string @this) | ||
{ | ||
if (string.IsNullOrEmpty(@this)) | ||
return false; | ||
for (var i = 0; i < @this.Length; i++) | ||
if (@this[i].IsKana()) | ||
return true; | ||
|
||
for (var i = 0; i < @this.Length; i++) | ||
if (@this[i].IsKanji()) | ||
return true; | ||
return false; | ||
} | ||
|
||
public static bool HasKanji(this string @this) | ||
{ | ||
if (string.IsNullOrEmpty(@this)) | ||
return false; | ||
} | ||
|
||
public static bool HasKanaOrKanji(this string @this) | ||
{ | ||
if (string.IsNullOrEmpty(@this)) | ||
return false; | ||
for (var i = 0; i < @this.Length; i++) | ||
if (@this[i].IsKanji()) | ||
return true; | ||
|
||
for (var i = 0; i < @this.Length; i++) | ||
if (@this[i].IsKanaOrKanji()) | ||
return true; | ||
return false; | ||
} | ||
|
||
public static bool HasKanaOrKanji(this string @this) | ||
{ | ||
if (string.IsNullOrEmpty(@this)) | ||
return false; | ||
} | ||
|
||
public static bool HasRomaji(this string @this) | ||
{ | ||
if (string.IsNullOrEmpty(@this)) | ||
return false; | ||
for (var i = 0; i < @this.Length; i++) | ||
if (@this[i].IsKanaOrKanji()) | ||
return true; | ||
|
||
for (var i = 0; i < @this.Length; i++) | ||
if (@this[i].IsRomaji()) | ||
return true; | ||
return false; | ||
} | ||
|
||
public static bool HasRomaji(this string @this) | ||
{ | ||
if (string.IsNullOrEmpty(@this)) | ||
return false; | ||
} | ||
|
||
#endregion | ||
for (var i = 0; i < @this.Length; i++) | ||
if (@this[i].IsRomaji()) | ||
return true; | ||
|
||
return false; | ||
} | ||
|
||
#endregion | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> | ||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=extensions/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=resources/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary> |
Oops, something went wrong.