Skip to content

Commit

Permalink
Merge pull request #10 from MarvNC/fix-jmdict-revision
Browse files Browse the repository at this point in the history
Fix JMdict Revision Date
  • Loading branch information
djahandarie authored Oct 1, 2023
2 parents 755db87 + 3d2ecaa commit 5a6c9f7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion jmdict.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,13 @@ func doDisplaySenseNumberTag(headword headword, entry jmdict.JmdictEntry, meta j

func jmdictPublicationDate(dictionary jmdict.Jmdict) string {
unknownDate := "unknown"
idx := len(dictionary.Entries) - 1
idx := -1
for i, entry := range dictionary.Entries {
if entry.Sequence == 9999999 {
idx = i
break
}
}
if len(dictionary.Entries) == 0 {
return unknownDate
} else if len(dictionary.Entries[idx].Sense) == 0 {
Expand Down

0 comments on commit 5a6c9f7

Please sign in to comment.