Simplify logic for index.json
struct
This commit is contained in:
parent
184dd45dbc
commit
abbe183145
@ -214,6 +214,7 @@ func writeDb(outputPath string, index dbIndex, recordData map[string]dbRecordLis
|
||||
}
|
||||
}
|
||||
|
||||
index.setDefaults()
|
||||
bytes, err := marshalJSON(index, pretty)
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -105,10 +105,8 @@ func jmnedictExportDb(inputPath, outputPath, language, title string, stride int,
|
||||
Title: title,
|
||||
Revision: "jmnedict1",
|
||||
Sequenced: true,
|
||||
Description: "",
|
||||
Attribution: edrdgAttribution,
|
||||
}
|
||||
index.setDefaults()
|
||||
|
||||
return writeDb(
|
||||
outputPath,
|
||||
|
@ -102,13 +102,10 @@ func epwingExportDb(inputPath, outputPath, language, title string, stride int, p
|
||||
}
|
||||
|
||||
index := dbIndex{
|
||||
Title: title,
|
||||
Revision: strings.Join(revisions, ";"),
|
||||
Sequenced: true,
|
||||
Description: "",
|
||||
Attribution: "",
|
||||
Title: title,
|
||||
Revision: strings.Join(revisions, ";"),
|
||||
Sequenced: true,
|
||||
}
|
||||
index.setDefaults()
|
||||
|
||||
return writeDb(
|
||||
outputPath,
|
||||
|
@ -56,13 +56,10 @@ func frequncyExportDb(inputPath, outputPath, language, title string, stride int,
|
||||
}
|
||||
|
||||
index := dbIndex{
|
||||
Title: title,
|
||||
Revision: "frequency1",
|
||||
Sequenced: false,
|
||||
Description: "",
|
||||
Attribution: "",
|
||||
Title: title,
|
||||
Revision: "frequency1",
|
||||
Sequenced: false,
|
||||
}
|
||||
index.setDefaults()
|
||||
|
||||
return writeDb(
|
||||
outputPath,
|
||||
|
@ -238,7 +238,6 @@ func jmdExportDb(inputPath string, outputPath string, languageName string, title
|
||||
Sequenced: true,
|
||||
Attribution: edrdgAttribution,
|
||||
}
|
||||
index.setDefaults()
|
||||
|
||||
return writeDb(
|
||||
outputPath,
|
||||
|
@ -254,7 +254,6 @@ func formsExportDb(inputPath, outputPath, languageName, title string, stride int
|
||||
Sequenced: true,
|
||||
Attribution: edrdgAttribution,
|
||||
}
|
||||
index.setDefaults()
|
||||
|
||||
return writeDb(
|
||||
outputPath,
|
||||
|
@ -163,10 +163,8 @@ func kanjidicExportDb(inputPath, outputPath, language, title string, stride int,
|
||||
Title: title,
|
||||
Revision: "kanjidic2",
|
||||
Sequenced: false,
|
||||
Description: "",
|
||||
Attribution: edrdgAttribution,
|
||||
}
|
||||
index.setDefaults()
|
||||
|
||||
return writeDb(
|
||||
outputPath,
|
||||
|
9
rikai.go
9
rikai.go
@ -153,13 +153,10 @@ func rikaiExportDb(inputPath, outputPath, language, title string, stride int, pr
|
||||
}
|
||||
|
||||
index := dbIndex{
|
||||
Title: title,
|
||||
Revision: "rikai2",
|
||||
Sequenced: true,
|
||||
Description: "",
|
||||
Attribution: "",
|
||||
Title: title,
|
||||
Revision: "rikai2",
|
||||
Sequenced: true,
|
||||
}
|
||||
index.setDefaults()
|
||||
|
||||
return writeDb(
|
||||
outputPath,
|
||||
|
Loading…
Reference in New Issue
Block a user