Use empty interface type for dictionary glossaries
Necesssary for structured content support
This commit is contained in:
parent
9222417bfd
commit
853d0b33dc
@ -21,7 +21,7 @@ const (
|
||||
|
||||
const databaseFormat = 3
|
||||
|
||||
type dbRecord []interface{}
|
||||
type dbRecord []any
|
||||
type dbRecordList []dbRecord
|
||||
|
||||
type dbTag struct {
|
||||
@ -46,7 +46,7 @@ func (meta dbTagList) crush() dbRecordList {
|
||||
type dbMeta struct {
|
||||
Expression string
|
||||
Mode string
|
||||
Data interface{}
|
||||
Data any
|
||||
}
|
||||
|
||||
type dbMetaList []dbMeta
|
||||
@ -66,7 +66,7 @@ type dbTerm struct {
|
||||
DefinitionTags []string
|
||||
Rules []string
|
||||
Score int
|
||||
Glossary []string
|
||||
Glossary []any
|
||||
Sequence int
|
||||
TermTags []string
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ func (e *daijirinExtractor) extractTerms(entry zig.BookEntry, sequence int) []db
|
||||
for _, reading := range readings {
|
||||
term := dbTerm{
|
||||
Expression: reading,
|
||||
Glossary: []string{entry.Text},
|
||||
Glossary: []any{entry.Text},
|
||||
Sequence: sequence,
|
||||
}
|
||||
|
||||
@ -79,7 +79,7 @@ func (e *daijirinExtractor) extractTerms(entry zig.BookEntry, sequence int) []db
|
||||
term := dbTerm{
|
||||
Expression: expression,
|
||||
Reading: reading,
|
||||
Glossary: []string{entry.Text},
|
||||
Glossary: []any{entry.Text},
|
||||
Sequence: sequence,
|
||||
}
|
||||
|
||||
|
@ -70,7 +70,7 @@ func (e *daijisenExtractor) extractTerms(entry zig.BookEntry, sequence int) []db
|
||||
if len(expressions) == 0 {
|
||||
term := dbTerm{
|
||||
Expression: reading,
|
||||
Glossary: []string{entry.Text},
|
||||
Glossary: []any{entry.Text},
|
||||
Sequence: sequence,
|
||||
}
|
||||
|
||||
@ -82,7 +82,7 @@ func (e *daijisenExtractor) extractTerms(entry zig.BookEntry, sequence int) []db
|
||||
term := dbTerm{
|
||||
Expression: expression,
|
||||
Reading: reading,
|
||||
Glossary: []string{entry.Text},
|
||||
Glossary: []any{entry.Text},
|
||||
Sequence: sequence,
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,9 @@ func jmnedictExtractTerms(enamdictEntry jmdict.JmnedictEntry) []dbTerm {
|
||||
}
|
||||
|
||||
for _, trans := range enamdictEntry.Translations {
|
||||
term.Glossary = append(term.Glossary, trans.Translations...)
|
||||
for _, translation := range trans.Translations {
|
||||
term.Glossary = append(term.Glossary, translation)
|
||||
}
|
||||
term.addDefinitionTags(trans.NameTypes...)
|
||||
}
|
||||
|
||||
|
@ -90,7 +90,7 @@ func (e *gakkenExtractor) extractTerms(entry zig.BookEntry, sequence int) []dbTe
|
||||
for _, reading := range readings {
|
||||
term := dbTerm{
|
||||
Expression: reading,
|
||||
Glossary: []string{entryText},
|
||||
Glossary: []any{entryText},
|
||||
Sequence: sequence,
|
||||
}
|
||||
|
||||
@ -107,7 +107,7 @@ func (e *gakkenExtractor) extractTerms(entry zig.BookEntry, sequence int) []dbTe
|
||||
term := dbTerm{
|
||||
Expression: expression,
|
||||
Reading: reading,
|
||||
Glossary: []string{entryText},
|
||||
Glossary: []any{entryText},
|
||||
Sequence: sequence,
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ func (e *kotowazaExtractor) extractTerms(entry zig.BookEntry, sequence int) []db
|
||||
term := dbTerm{
|
||||
Expression: expression,
|
||||
Reading: reading,
|
||||
Glossary: []string{entry.Text},
|
||||
Glossary: []any{entry.Text},
|
||||
Sequence: sequence,
|
||||
}
|
||||
|
||||
|
@ -75,7 +75,7 @@ func (e *koujienExtractor) extractTerms(entry zig.BookEntry, sequence int) []dbT
|
||||
for _, reading := range readings {
|
||||
term := dbTerm{
|
||||
Expression: reading,
|
||||
Glossary: []string{entry.Text},
|
||||
Glossary: []any{entry.Text},
|
||||
Sequence: sequence,
|
||||
}
|
||||
|
||||
@ -89,7 +89,7 @@ func (e *koujienExtractor) extractTerms(entry zig.BookEntry, sequence int) []dbT
|
||||
term := dbTerm{
|
||||
Expression: expression,
|
||||
Reading: reading,
|
||||
Glossary: []string{entry.Text},
|
||||
Glossary: []any{entry.Text},
|
||||
Sequence: sequence,
|
||||
}
|
||||
|
||||
|
@ -106,7 +106,7 @@ func (e *meikyouExtractor) extractTerms(entry zig.BookEntry, sequence int) []dbT
|
||||
for _, reading := range readings {
|
||||
term := dbTerm{
|
||||
Expression: reading,
|
||||
Glossary: []string{entry.Text},
|
||||
Glossary: []any{entry.Text},
|
||||
Sequence: sequence,
|
||||
}
|
||||
|
||||
@ -120,7 +120,7 @@ func (e *meikyouExtractor) extractTerms(entry zig.BookEntry, sequence int) []dbT
|
||||
term := dbTerm{
|
||||
Expression: expression,
|
||||
Reading: reading,
|
||||
Glossary: []string{entry.Text},
|
||||
Glossary: []any{entry.Text},
|
||||
Sequence: sequence,
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,7 @@ func (e *shougakukan2Extractor) extractTerms(entry zig.BookEntry, sequence int)
|
||||
terms = append(terms, dbTerm{
|
||||
Expression: expression,
|
||||
Reading: reading,
|
||||
Glossary: []string{entry.Text},
|
||||
Glossary: []any{entry.Text},
|
||||
Sequence: sequence,
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user