Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
rampaa committed Dec 28, 2024
1 parent 1ec4dc4 commit eba0fed
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion JL.Core.Tests/LookupTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void LookupText_始まる()
deconjugatedMatchedText: "始まる",
readings: ["はじまる"],
formattedDefinitions: "(v5r, vi) (1) to begin; to start; to commence;(v5r, vi) (2) to happen (again); to begin (anew);(v5r, vi) (3) to date (from); to originate (in)",
edictId: 1307500
entryId: 1307500
)
];

Expand Down
6 changes: 3 additions & 3 deletions JL.Core/Lookup/LookupResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public sealed class LookupResult
public List<LookupFrequencyResult>? Frequencies { get; }

// JMdict, JMnedict, KANJIDIC2
internal int EdictId { get; }
internal int EntryId { get; }

// Word dictionaries
public string DeconjugatedMatchedText { get; }
Expand Down Expand Up @@ -57,7 +57,7 @@ internal LookupResult(
string? deconjugationProcess = null,
string? kanjiComposition = null,
string? kanjiStats = null,
int edictId = 0,
int entryId = 0,
byte strokeCount = 0,
byte kanjiGrade = byte.MaxValue,
IDictionary<string, IList<IDictRecord>>? pitchAccentDict = null
Expand All @@ -70,7 +70,7 @@ internal LookupResult(
PrimarySpelling = primarySpelling;
Readings = readings;
FormattedDefinitions = formattedDefinitions;
EdictId = edictId;
EntryId = entryId;
AlternativeSpellings = alternativeSpellings;
DeconjugationProcess = deconjugationProcess;
PrimarySpellingOrthographyInfoList = primarySpellingOrthographyInfoList;
Expand Down
5 changes: 3 additions & 2 deletions JL.Core/Lookup/LookupUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ private static LookupResult[] SortLookupResults(IEnumerable<LookupResult> lookup
? index
: int.MaxValue;
})
.ThenBy(static lookupResult => lookupResult.EntryId)
.ToArray();
}

Expand Down Expand Up @@ -963,7 +964,7 @@ private static List<LookupResult> BuildJmdictResult(
readings: jmdictResult.Readings,
matchedText: wordResult.MatchedText,
deconjugatedMatchedText: wordResult.DeconjugatedMatchedText,
edictId: jmdictResult.Id,
entryId: jmdictResult.Id,
alternativeSpellings: jmdictResult.AlternativeSpellings,
deconjugationProcess: LookupResultUtils.DeconjugationProcessesToText(wordResult.Processes?[i]),
frequencies: GetWordFrequencies(jmdictResult, wordFreqs, frequencyDicts),
Expand Down Expand Up @@ -1008,7 +1009,7 @@ private static List<LookupResult> BuildJmnedictResult(

LookupResult result = new
(
edictId: jmnedictRecord.Id,
entryId: jmnedictRecord.Id,
primarySpelling: jmnedictRecord.PrimarySpelling,
alternativeSpellings: jmnedictRecord.AlternativeSpellings,
readings: jmnedictRecord.Readings,
Expand Down
8 changes: 4 additions & 4 deletions JL.Core/Mining/MiningUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ public static class MiningUtils
: null;

case JLField.EdictId:
return lookupResult.EdictId > 0
? lookupResult.EdictId.ToString(CultureInfo.InvariantCulture)
return lookupResult.EntryId > 0
? lookupResult.EntryId.ToString(CultureInfo.InvariantCulture)
: null;

case JLField.DeconjugationProcess:
Expand Down Expand Up @@ -481,9 +481,9 @@ private static Dictionary<JLField, string> GetMiningParameters(LookupResult look
: selectedDefinitions;
}

if (lookupResult.EdictId > 0)
if (lookupResult.EntryId > 0)
{
miningParams[JLField.EdictId] = lookupResult.EdictId.ToString(CultureInfo.InvariantCulture);
miningParams[JLField.EdictId] = lookupResult.EntryId.ToString(CultureInfo.InvariantCulture);
}

if (lookupResult.DeconjugationProcess is not null)
Expand Down

0 comments on commit eba0fed

Please sign in to comment.