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)
|
bytes, err := marshalJSON(index, pretty)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -105,10 +105,8 @@ func jmnedictExportDb(inputPath, outputPath, language, title string, stride int,
|
|||||||
Title: title,
|
Title: title,
|
||||||
Revision: "jmnedict1",
|
Revision: "jmnedict1",
|
||||||
Sequenced: true,
|
Sequenced: true,
|
||||||
Description: "",
|
|
||||||
Attribution: edrdgAttribution,
|
Attribution: edrdgAttribution,
|
||||||
}
|
}
|
||||||
index.setDefaults()
|
|
||||||
|
|
||||||
return writeDb(
|
return writeDb(
|
||||||
outputPath,
|
outputPath,
|
||||||
|
@ -102,13 +102,10 @@ func epwingExportDb(inputPath, outputPath, language, title string, stride int, p
|
|||||||
}
|
}
|
||||||
|
|
||||||
index := dbIndex{
|
index := dbIndex{
|
||||||
Title: title,
|
Title: title,
|
||||||
Revision: strings.Join(revisions, ";"),
|
Revision: strings.Join(revisions, ";"),
|
||||||
Sequenced: true,
|
Sequenced: true,
|
||||||
Description: "",
|
|
||||||
Attribution: "",
|
|
||||||
}
|
}
|
||||||
index.setDefaults()
|
|
||||||
|
|
||||||
return writeDb(
|
return writeDb(
|
||||||
outputPath,
|
outputPath,
|
||||||
|
@ -56,13 +56,10 @@ func frequncyExportDb(inputPath, outputPath, language, title string, stride int,
|
|||||||
}
|
}
|
||||||
|
|
||||||
index := dbIndex{
|
index := dbIndex{
|
||||||
Title: title,
|
Title: title,
|
||||||
Revision: "frequency1",
|
Revision: "frequency1",
|
||||||
Sequenced: false,
|
Sequenced: false,
|
||||||
Description: "",
|
|
||||||
Attribution: "",
|
|
||||||
}
|
}
|
||||||
index.setDefaults()
|
|
||||||
|
|
||||||
return writeDb(
|
return writeDb(
|
||||||
outputPath,
|
outputPath,
|
||||||
|
@ -238,7 +238,6 @@ func jmdExportDb(inputPath string, outputPath string, languageName string, title
|
|||||||
Sequenced: true,
|
Sequenced: true,
|
||||||
Attribution: edrdgAttribution,
|
Attribution: edrdgAttribution,
|
||||||
}
|
}
|
||||||
index.setDefaults()
|
|
||||||
|
|
||||||
return writeDb(
|
return writeDb(
|
||||||
outputPath,
|
outputPath,
|
||||||
|
@ -254,7 +254,6 @@ func formsExportDb(inputPath, outputPath, languageName, title string, stride int
|
|||||||
Sequenced: true,
|
Sequenced: true,
|
||||||
Attribution: edrdgAttribution,
|
Attribution: edrdgAttribution,
|
||||||
}
|
}
|
||||||
index.setDefaults()
|
|
||||||
|
|
||||||
return writeDb(
|
return writeDb(
|
||||||
outputPath,
|
outputPath,
|
||||||
|
@ -163,10 +163,8 @@ func kanjidicExportDb(inputPath, outputPath, language, title string, stride int,
|
|||||||
Title: title,
|
Title: title,
|
||||||
Revision: "kanjidic2",
|
Revision: "kanjidic2",
|
||||||
Sequenced: false,
|
Sequenced: false,
|
||||||
Description: "",
|
|
||||||
Attribution: edrdgAttribution,
|
Attribution: edrdgAttribution,
|
||||||
}
|
}
|
||||||
index.setDefaults()
|
|
||||||
|
|
||||||
return writeDb(
|
return writeDb(
|
||||||
outputPath,
|
outputPath,
|
||||||
|
9
rikai.go
9
rikai.go
@ -153,13 +153,10 @@ func rikaiExportDb(inputPath, outputPath, language, title string, stride int, pr
|
|||||||
}
|
}
|
||||||
|
|
||||||
index := dbIndex{
|
index := dbIndex{
|
||||||
Title: title,
|
Title: title,
|
||||||
Revision: "rikai2",
|
Revision: "rikai2",
|
||||||
Sequenced: true,
|
Sequenced: true,
|
||||||
Description: "",
|
|
||||||
Attribution: "",
|
|
||||||
}
|
}
|
||||||
index.setDefaults()
|
|
||||||
|
|
||||||
return writeDb(
|
return writeDb(
|
||||||
outputPath,
|
outputPath,
|
||||||
|
Loading…
Reference in New Issue
Block a user