Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
rampaa committed Feb 11, 2025
1 parent 3d4a3b0 commit 6bf61d6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions JL.Core/Lookup/LookupUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1046,12 +1046,13 @@ private static bool WordClassDictionaryContainsTag(string primarySpelling, strin
{
if (DictUtils.WordClassDictionary.TryGetValue(primarySpelling, out IList<JmdictWordClass>? jmdictWcResults))
{
bool hasReading = reading is not null;
for (int i = 0; i < jmdictWcResults.Count; i++)
{
JmdictWordClass result = jmdictWcResults[i];
if (primarySpelling == result.Spelling
&& ((reading is not null && result.Readings is not null && result.Readings.Contains(reading))
|| (reading is null && result.Readings is null))
&& ((hasReading && result.Readings is not null && result.Readings.Contains(reading!))
|| (!hasReading && result.Readings is null))
&& result.WordClasses.Contains(tag))
{
return true;
Expand Down

0 comments on commit 6bf61d6

Please sign in to comment.