Skip to content

Commit

Permalink
Minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rampaa committed Jan 11, 2025
1 parent f0fcbb9 commit 3235241
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 16 deletions.
10 changes: 6 additions & 4 deletions JL.Core/Dicts/CustomWordDict/CustomWordRecord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public int GetFrequency(IDictionary<string, IList<FrequencyRecord>> freqDict)
for (int i = 0; i < freqResultCount; i++)
{
FrequencyRecord freqResult = freqResults[i];
if (PrimarySpelling == freqResult.Spelling
if (freqResult.Spelling == PrimarySpelling
|| (readingsExist && Readings!.Contains(freqResult.Spelling)))
{
return freqResult.Frequency;
Expand All @@ -112,7 +112,8 @@ public int GetFrequency(IDictionary<string, IList<FrequencyRecord>> freqDict)
for (int j = 0; j < readingFreqResultCount; j++)
{
FrequencyRecord readingFreqResult = readingFreqResults[j];
if (reading == readingFreqResult.Spelling && JapaneseUtils.IsKatakana(reading[0]))
if (readingFreqResult.Spelling == PrimarySpelling
|| (reading == readingFreqResult.Spelling && JapaneseUtils.IsKatakana(reading[0])))
{
return readingFreqResult.Frequency;
}
Expand All @@ -133,7 +134,7 @@ public int GetFrequency(Dictionary<string, List<FrequencyRecord>> freqDict)
for (int i = 0; i < freqResultCount; i++)
{
FrequencyRecord freqResult = freqResults[i];
if (PrimarySpelling == freqResult.Spelling
if (freqResult.Spelling == PrimarySpelling
|| (readingsExist && Readings!.Contains(freqResult.Spelling)))
{
return freqResult.Frequency;
Expand All @@ -152,7 +153,8 @@ public int GetFrequency(Dictionary<string, List<FrequencyRecord>> freqDict)
for (int j = 0; j < readingFreqResultCount; j++)
{
FrequencyRecord readingFreqResult = readingFreqResults[j];
if (reading == readingFreqResult.Spelling && JapaneseUtils.IsKatakana(reading[0]))
if (readingFreqResult.Spelling == PrimarySpelling
|| (reading == readingFreqResult.Spelling && JapaneseUtils.IsKatakana(reading[0])))
{
return readingFreqResult.Frequency;
}
Expand Down
10 changes: 6 additions & 4 deletions JL.Core/Dicts/EPWING/Nazeka/EpwingNazekaRecord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public int GetFrequency(IDictionary<string, IList<FrequencyRecord>> freqDict)
for (int i = 0; i < freqResultCount; i++)
{
FrequencyRecord freqResult = freqResults[i];
if (PrimarySpelling == freqResult.Spelling || Reading == freqResult.Spelling)
if (freqResult.Spelling == PrimarySpelling || freqResult.Spelling == Reading)
{
return freqResult.Frequency;
}
Expand All @@ -68,7 +68,8 @@ public int GetFrequency(IDictionary<string, IList<FrequencyRecord>> freqDict)
for (int j = 0; j < readingFreqResultCount; j++)
{
FrequencyRecord readingFreqResult = readingFreqResults[j];
if (Reading == readingFreqResult.Spelling && JapaneseUtils.IsKatakana(Reading[0]))
if (readingFreqResult.Spelling == PrimarySpelling
|| (readingFreqResult.Spelling == Reading && JapaneseUtils.IsKatakana(Reading[0])))
{
return readingFreqResult.Frequency;
}
Expand All @@ -87,7 +88,7 @@ public int GetFrequency(Dictionary<string, List<FrequencyRecord>> freqDict)
for (int i = 0; i < freqResultCount; i++)
{
FrequencyRecord freqResult = freqResults[i];
if (PrimarySpelling == freqResult.Spelling || Reading == freqResult.Spelling)
if (freqResult.Spelling == PrimarySpelling || freqResult.Spelling == Reading)
{
return freqResult.Frequency;
}
Expand All @@ -102,7 +103,8 @@ public int GetFrequency(Dictionary<string, List<FrequencyRecord>> freqDict)
for (int j = 0; j < readingFreqResultCount; j++)
{
FrequencyRecord readingFreqResult = readingFreqResults[j];
if (Reading == readingFreqResult.Spelling && JapaneseUtils.IsKatakana(Reading[0]))
if (readingFreqResult.Spelling == PrimarySpelling
|| (readingFreqResult.Spelling == Reading && JapaneseUtils.IsKatakana(Reading[0])))
{
return readingFreqResult.Frequency;
}
Expand Down
10 changes: 6 additions & 4 deletions JL.Core/Dicts/EPWING/Yomichan/EpwingYomichanRecord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public int GetFrequency(IDictionary<string, IList<FrequencyRecord>> freqDict)
for (int i = 0; i < freqResultCount; i++)
{
FrequencyRecord freqResult = freqResults[i];
if (PrimarySpelling == freqResult.Spelling || Reading == freqResult.Spelling)
if (freqResult.Spelling == PrimarySpelling || freqResult.Spelling == Reading)
{
return freqResult.Frequency;
}
Expand All @@ -91,7 +91,8 @@ public int GetFrequency(IDictionary<string, IList<FrequencyRecord>> freqDict)
for (int j = 0; j < readingFreqResultCount; j++)
{
FrequencyRecord readingFreqResult = readingFreqResults[j];
if (Reading == readingFreqResult.Spelling && JapaneseUtils.IsKatakana(Reading[0]))
if (readingFreqResult.Spelling == PrimarySpelling
|| (readingFreqResult.Spelling == Reading && JapaneseUtils.IsKatakana(Reading[0])))
{
return readingFreqResult.Frequency;
}
Expand All @@ -111,7 +112,7 @@ public int GetFrequency(Dictionary<string, List<FrequencyRecord>> freqDict)
for (int i = 0; i < freqResultCount; i++)
{
FrequencyRecord freqResult = freqResults[i];
if (PrimarySpelling == freqResult.Spelling || Reading == freqResult.Spelling)
if (freqResult.Spelling == PrimarySpelling || freqResult.Spelling == Reading)
{
return freqResult.Frequency;
}
Expand All @@ -124,7 +125,8 @@ public int GetFrequency(Dictionary<string, List<FrequencyRecord>> freqDict)
for (int j = 0; j < readingFreqResultCount; j++)
{
FrequencyRecord readingFreqResult = readingFreqResults[j];
if (Reading == readingFreqResult.Spelling && JapaneseUtils.IsKatakana(Reading[0]))
if (readingFreqResult.Spelling == PrimarySpelling
|| (readingFreqResult.Spelling == Reading && JapaneseUtils.IsKatakana(Reading[0])))
{
return readingFreqResult.Frequency;
}
Expand Down
10 changes: 6 additions & 4 deletions JL.Core/Dicts/JMdict/JmdictRecord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public int GetFrequency(IDictionary<string, IList<FrequencyRecord>> freqDict)
for (int i = 0; i < freqResultCount; i++)
{
FrequencyRecord freqResult = freqResults[i];
if (PrimarySpelling == freqResult.Spelling
if (freqResult.Spelling == PrimarySpelling
|| (readingsExist && Readings!.Contains(freqResult.Spelling)))
{
return freqResult.Frequency;
Expand All @@ -262,7 +262,8 @@ public int GetFrequency(IDictionary<string, IList<FrequencyRecord>> freqDict)
for (int j = 0; j < readingFreqResultCount; j++)
{
FrequencyRecord readingFreqResult = readingFreqResults[j];
if (reading == readingFreqResult.Spelling && JapaneseUtils.IsKatakana(reading[0]))
if (readingFreqResult.Spelling == PrimarySpelling
|| (reading == readingFreqResult.Spelling && JapaneseUtils.IsKatakana(reading[0])))
{
return readingFreqResult.Frequency;
}
Expand All @@ -283,7 +284,7 @@ public int GetFrequency(Dictionary<string, List<FrequencyRecord>> freqDict)
for (int i = 0; i < freqResultCount; i++)
{
FrequencyRecord freqResult = freqResults[i];
if (PrimarySpelling == freqResult.Spelling
if (freqResult.Spelling == PrimarySpelling
|| (readingsExist && Readings!.Contains(freqResult.Spelling)))
{
return freqResult.Frequency;
Expand All @@ -302,7 +303,8 @@ public int GetFrequency(Dictionary<string, List<FrequencyRecord>> freqDict)
for (int j = 0; j < readingFreqResultCount; j++)
{
FrequencyRecord readingFreqResult = readingFreqResults[j];
if (reading == readingFreqResult.Spelling && JapaneseUtils.IsKatakana(reading[0]))
if (readingFreqResult.Spelling == PrimarySpelling
|| (reading == readingFreqResult.Spelling && JapaneseUtils.IsKatakana(reading[0])))
{
return readingFreqResult.Frequency;
}
Expand Down

0 comments on commit 3235241

Please sign in to comment.