add sequenced tag to dictionary header
This commit is contained in:
parent
78a6e4c0f0
commit
222f899892
10
common.go
10
common.go
@ -156,7 +156,7 @@ func (kanji dbKanjiList) crush() dbRecordList {
|
||||
return results
|
||||
}
|
||||
|
||||
func writeDb(outputPath, title, revision string, recordData map[string]dbRecordList, stride int, pretty bool) error {
|
||||
func writeDb(outputPath, title, revision string, sequenced bool, recordData map[string]dbRecordList, stride int, pretty bool) error {
|
||||
var zbuff bytes.Buffer
|
||||
zip := zip.NewWriter(&zbuff)
|
||||
|
||||
@ -201,14 +201,16 @@ func writeDb(outputPath, title, revision string, recordData map[string]dbRecordL
|
||||
|
||||
var err error
|
||||
var db struct {
|
||||
Title string `json:"title"`
|
||||
Format int `json:"format"`
|
||||
Revision string `json:"revision"`
|
||||
Title string `json:"title"`
|
||||
Format int `json:"format"`
|
||||
Revision string `json:"revision"`
|
||||
Sequenced bool `json:"sequenced"`
|
||||
}
|
||||
|
||||
db.Title = title
|
||||
db.Format = databaseFormat
|
||||
db.Revision = revision
|
||||
db.Sequenced = sequenced
|
||||
|
||||
for recordType, recordEntries := range recordData {
|
||||
if _, err := writeDbRecords(recordType, recordEntries); err != nil {
|
||||
|
3
edict.go
3
edict.go
@ -195,7 +195,7 @@ func jmdictExtractTerms(edictEntry jmdict.JmdictEntry, language string) []dbTerm
|
||||
}
|
||||
}
|
||||
for _, reading := range edictEntry.Readings {
|
||||
if reading.NoKanji != nil {
|
||||
if reading.NoKanji != nil {
|
||||
convert(reading, nil)
|
||||
}
|
||||
}
|
||||
@ -260,6 +260,7 @@ func jmdictExportDb(inputPath, outputPath, language, title string, stride int, p
|
||||
outputPath,
|
||||
title,
|
||||
jmdictRevision,
|
||||
true,
|
||||
recordData,
|
||||
stride,
|
||||
pretty,
|
||||
|
@ -127,6 +127,7 @@ func jmnedictExportDb(inputPath, outputPath, language, title string, stride int,
|
||||
outputPath,
|
||||
title,
|
||||
jmnedictRevision,
|
||||
true,
|
||||
recordData,
|
||||
stride,
|
||||
pretty,
|
||||
|
@ -213,6 +213,7 @@ func epwingExportDb(inputPath, outputPath, language, title string, stride int, p
|
||||
outputPath,
|
||||
title,
|
||||
strings.Join(revisions, ";"),
|
||||
true,
|
||||
recordData,
|
||||
stride,
|
||||
pretty,
|
||||
|
@ -83,6 +83,7 @@ func frequncyExportDb(inputPath, outputPath, language, title string, stride int,
|
||||
outputPath,
|
||||
title,
|
||||
frequencyRevision,
|
||||
false,
|
||||
recordData,
|
||||
stride,
|
||||
pretty,
|
||||
|
@ -187,6 +187,7 @@ func kanjidicExportDb(inputPath, outputPath, language, title string, stride int,
|
||||
outputPath,
|
||||
title,
|
||||
kanjidicRevision,
|
||||
false,
|
||||
recordData,
|
||||
stride,
|
||||
pretty,
|
||||
|
Loading…
Reference in New Issue
Block a user