1

add sequenced tag to dictionary header

This commit is contained in:
Alex Yatskov 2017-10-29 11:42:36 -07:00
parent 78a6e4c0f0
commit 222f899892
7 changed files with 13 additions and 5 deletions

View File

@ -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 {

View File

@ -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,

View File

@ -127,6 +127,7 @@ func jmnedictExportDb(inputPath, outputPath, language, title string, stride int,
outputPath,
title,
jmnedictRevision,
true,
recordData,
stride,
pretty,

View File

@ -213,6 +213,7 @@ func epwingExportDb(inputPath, outputPath, language, title string, stride int, p
outputPath,
title,
strings.Join(revisions, ";"),
true,
recordData,
stride,
pretty,

View File

@ -83,6 +83,7 @@ func frequncyExportDb(inputPath, outputPath, language, title string, stride int,
outputPath,
title,
frequencyRevision,
false,
recordData,
stride,
pretty,

View File

@ -187,6 +187,7 @@ func kanjidicExportDb(inputPath, outputPath, language, title string, stride int,
outputPath,
title,
kanjidicRevision,
false,
recordData,
stride,
pretty,

View File

@ -180,6 +180,7 @@ func rikaiExportDb(inputPath, outputPath, language, title string, stride int, pr
outputPath,
title,
rikaiRevision,
true,
recordData,
stride,
pretty,