Skip to content

Commit

Permalink
Closes #95
Browse files Browse the repository at this point in the history
  • Loading branch information
rampaa committed Aug 4, 2024
1 parent 08f8aa4 commit 972e737
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion JL.Core/Dicts/EPWING/Nazeka/EpwingNazekaDBManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace JL.Core.Dicts.EPWING.Nazeka;

internal static class EpwingNazekaDBManager
{
public const int Version = 1;
public const int Version = 2;

private const string SingleTermQuery =
"""
Expand Down
2 changes: 1 addition & 1 deletion JL.Core/Dicts/EPWING/Yomichan/EpwingYomichanDBManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace JL.Core.Dicts.EPWING.Yomichan;

internal static class EpwingYomichanDBManager
{
public const int Version = 6;
public const int Version = 7;

private const string SingleTermQuery =
"""
Expand Down
2 changes: 1 addition & 1 deletion JL.Core/Dicts/JMdict/JmdictDBManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace JL.Core.Dicts.JMdict;

internal static class JmdictDBManager
{
public const int Version = 1;
public const int Version = 2;

public static void CreateDB(string dbName)
{
Expand Down
2 changes: 1 addition & 1 deletion JL.Core/Dicts/JMnedict/JmnedictDBManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace JL.Core.Dicts.JMnedict;

internal static class JmnedictDBManager
{
public const int Version = 0;
public const int Version = 1;

public static void CreateDB(string dbName)
{
Expand Down
2 changes: 1 addition & 1 deletion JL.Core/Dicts/PitchAccent/YomichanPitchAccentDBManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace JL.Core.Dicts.PitchAccent;

internal static class YomichanPitchAccentDBManager
{
public const int Version = 1;
public const int Version = 2;

private const string SingleTermQuery =
"""
Expand Down
2 changes: 1 addition & 1 deletion JL.Core/Freqs/FreqDBManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace JL.Core.Freqs;

internal static class FreqDBManager
{
public const int Version = 2;
public const int Version = 3;

public static void CreateDB(string dbName)
{
Expand Down
7 changes: 5 additions & 2 deletions JL.Core/Utilities/JapaneseUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,15 @@ private static int FirstKatakanaIndex(string text)
public static string KatakanaToHiragana(string text)
{
string normalizedText = text;
if (!text.IsNormalized(NormalizationForm.FormKC))
if (!normalizedText.IsNormalized(NormalizationForm.FormKC))
{
// Normalizes OL to OL, ガ to が, ワ to わ, ㍿ to 株式会社 etc.
normalizedText = text.Normalize(NormalizationForm.FormKC);
normalizedText = normalizedText.Normalize(NormalizationForm.FormKC);
}

// Normalizes vs to VS, xxx to XXX, h to H etc.
normalizedText = normalizedText.ToUpperInvariant();

int firstKatakanaIndex = FirstKatakanaIndex(normalizedText);
if (firstKatakanaIndex is -1)
{
Expand Down

0 comments on commit 972e737

Please sign in to comment.