Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
rampaa committed Dec 22, 2024
1 parent 84acd9a commit cd7c1f4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
3 changes: 1 addition & 2 deletions JL.Core/Freqs/Freq.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@ public sealed class Freq(FreqType type, string name, string path, bool active, i

// ReSharper disable once MemberCanBeInternal
public int MaxValue { get; set; } = maxValue;

[JsonIgnore] public bool Ready { get; set; } // = false;
public FreqOptions Options { get; set; } = options;

#pragma warning disable CA2227
[JsonIgnore] public IDictionary<string, IList<FrequencyRecord>> Contents { get; set; } = FrozenDictionary<string, IList<FrequencyRecord>>.Empty;
#pragma warning restore CA2227

public FreqOptions Options { get; set; } = options;
}
6 changes: 2 additions & 4 deletions JL.Core/WordClass/JmdictWordClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@

namespace JL.Core.WordClass;

internal sealed class JmdictWordClass(string spelling, string[]? readings, string[] wordClasses)
internal sealed class JmdictWordClass(string spelling, string[] wordClasses, string[]? readings = null)
{
[JsonPropertyName("S")] public string Spelling { get; set; } = spelling;

[JsonPropertyName("R")] public string[]? Readings { get; } = readings;

[JsonPropertyName("C")] public string[] WordClasses { get; } = wordClasses;
[JsonPropertyName("R")] public string[]? Readings { get; } = readings;
}
4 changes: 2 additions & 2 deletions JL.Core/WordClass/JmdictWordClassUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ public static Task Serialize()
&& ((result.Readings is not null && jmdictRecord.Readings is not null && result.Readings.SequenceEqual(jmdictRecord.Readings))
|| (result.Readings is null && jmdictRecord.Readings is null))))
{
results.Add(new JmdictWordClass(jmdictRecord.PrimarySpelling, jmdictRecord.Readings, wordClasses));
results.Add(new JmdictWordClass(jmdictRecord.PrimarySpelling, wordClasses, jmdictRecord.Readings));
}
}

else
{
jmdictWordClassDictionary[key] = [new JmdictWordClass(jmdictRecord.PrimarySpelling, jmdictRecord.Readings, wordClasses)];
jmdictWordClassDictionary[key] = [new JmdictWordClass(jmdictRecord.PrimarySpelling, wordClasses, jmdictRecord.Readings)];
}
}
}
Expand Down

0 comments on commit cd7c1f4

Please sign in to comment.