1

edict: fix PartsOfSpeech and Misc with Restricted*

This commit is contained in:
siikamiika 2017-10-12 07:01:36 +03:00
parent 5437ad22f1
commit 1ee4aae580

View File

@ -141,6 +141,15 @@ func jmdictExtractTerms(edictEntry jmdict.JmdictEntry, language string) []dbTerm
var partsOfSpeech []string
var misc []string
for index, sense := range edictEntry.Sense {
if len(sense.PartsOfSpeech) != 0 {
partsOfSpeech = sense.PartsOfSpeech
}
if len(sense.Misc) != 0 {
misc = sense.Misc
}
if sense.RestrictedReadings != nil && !hasString(reading.Reading, sense.RestrictedReadings) {
continue
}
@ -166,14 +175,6 @@ func jmdictExtractTerms(edictEntry jmdict.JmdictEntry, language string) []dbTerm
continue
}
if len(sense.PartsOfSpeech) != 0 {
partsOfSpeech = sense.PartsOfSpeech
}
if len(sense.Misc) != 0 {
misc = sense.Misc
}
term.addTags(termBase.Tags...)
term.addTermTags(termBase.TermTags...)
term.addTags(partsOfSpeech...)