diff --git a/common.go b/common.go index aa566c0..f3ff84c 100644 --- a/common.go +++ b/common.go @@ -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 } diff --git a/daijirin.go b/daijirin.go index 2c2b190..abc30e6 100644 --- a/daijirin.go +++ b/daijirin.go @@ -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, } diff --git a/daijisen.go b/daijisen.go index 5d663df..332bc46 100644 --- a/daijisen.go +++ b/daijisen.go @@ -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, } diff --git a/enamdict.go b/enamdict.go index f3df513..be12d5b 100644 --- a/enamdict.go +++ b/enamdict.go @@ -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...) } diff --git a/gakken.go b/gakken.go index b25f989..58e96b4 100644 --- a/gakken.go +++ b/gakken.go @@ -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, } diff --git a/kotowaza.go b/kotowaza.go index 7f713ae..fca8f7d 100644 --- a/kotowaza.go +++ b/kotowaza.go @@ -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, } diff --git a/koujien.go b/koujien.go index 89b7379..049d5a0 100644 --- a/koujien.go +++ b/koujien.go @@ -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, } diff --git a/meikyou.go b/meikyou.go index 78a3081..2ea33fe 100644 --- a/meikyou.go +++ b/meikyou.go @@ -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, } diff --git a/shougakukan2.go b/shougakukan2.go index 5b06ea6..7b16549 100644 --- a/shougakukan2.go +++ b/shougakukan2.go @@ -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, }) } diff --git a/wadai.go b/wadai.go index 2507b92..0226f64 100644 --- a/wadai.go +++ b/wadai.go @@ -74,7 +74,7 @@ func (e *wadaiExtractor) extractTerms(entry zig.BookEntry, sequence int) []dbTer term := dbTerm{ Expression: expression, Reading: reading, - Glossary: []string{entry.Text}, + Glossary: []any{entry.Text}, Sequence: sequence, }