edict: fix PartsOfSpeech and Misc with Restricted*
This commit is contained in:
parent
5437ad22f1
commit
1ee4aae580
17
edict.go
17
edict.go
@ -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...)
|
||||
|
Loading…
Reference in New Issue
Block a user