1

edict: add sequence

This commit is contained in:
siikamiika 2017-10-11 05:30:59 +03:00
parent bb8328b565
commit 46492eb926
2 changed files with 4 additions and 1 deletions

View File

@ -80,6 +80,7 @@ type dbTerm struct {
Rules []string
Score int
Glossary []string
Sequence int
}
type dbTermList []dbTerm
@ -102,6 +103,7 @@ func (terms dbTermList) crush() dbRecordList {
strings.Join(t.Rules, " "),
t.Score,
t.Glossary,
t.Sequence,
}
results = append(results, result)

View File

@ -29,7 +29,7 @@ import (
"github.com/FooSoft/jmdict"
)
const jmdictRevision = "jmdict3"
const jmdictRevision = "jmdict4"
func jmdictBuildRules(term *dbTerm) {
for _, tag := range term.Tags {
@ -138,6 +138,7 @@ func jmdictExtractTerms(edictEntry jmdict.JmdictEntry, language string) []dbTerm
Reading: termBase.Reading,
Expression: termBase.Expression,
Score: len(edictEntry.Sense) - index,
Sequence: edictEntry.Sequence,
}
for _, glossary := range sense.Glossary {