edict: add sequence
This commit is contained in:
parent
bb8328b565
commit
46492eb926
@ -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)
|
||||
|
3
edict.go
3
edict.go
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user