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,
|
||||||
|
@ -105,10 +105,7 @@ func epwingExportDb(inputPath, outputPath, language, title string, stride int, p
|
|||||||
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,
|
||||||
|
@ -59,10 +59,7 @@ func frequncyExportDb(inputPath, outputPath, language, title string, stride int,
|
|||||||
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,
|
||||||
|
3
rikai.go
3
rikai.go
@ -156,10 +156,7 @@ func rikaiExportDb(inputPath, outputPath, language, title string, stride int, pr
|
|||||||
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