cleanup
This commit is contained in:
parent
532838764b
commit
2017635e01
2
gui.go
2
gui.go
@ -136,7 +136,7 @@ func gui() error {
|
||||
}
|
||||
})
|
||||
|
||||
success = exportDb(inputPath, outputPath, format, language, title, DEFAULT_STRIDE, false) == nil
|
||||
success = exportDb(inputPath, outputPath, format, language, title, defaultStride, false) == nil
|
||||
}()
|
||||
})
|
||||
|
||||
|
@ -116,6 +116,10 @@ func kanjidicExportDb(inputPath, outputPath, language, title string, stride int,
|
||||
}
|
||||
}
|
||||
|
||||
if title == "" {
|
||||
title = "KANJIDIC2"
|
||||
}
|
||||
|
||||
tags := dbTagList{
|
||||
dbTag{Name: "jouyou", Notes: "included in list of regular-use characters", Category: "frequent", Order: -5},
|
||||
dbTag{Name: "jinmeiyou", Notes: "included in list of characters for use in personal names", Category: "frequent", Order: -5},
|
||||
@ -125,10 +129,6 @@ func kanjidicExportDb(inputPath, outputPath, language, title string, stride int,
|
||||
dbTag{Name: "heisig", Notes: "frame number in Remembering the Kanji"},
|
||||
}
|
||||
|
||||
if title == "" {
|
||||
title = "KANJIDIC2"
|
||||
}
|
||||
|
||||
recordData := map[string]dbRecordList{
|
||||
"kanji": kanji.crush(),
|
||||
"tags": tags.crush(),
|
||||
|
15
main.go
15
main.go
@ -34,9 +34,8 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
DEFAULT_STRIDE = 10000
|
||||
DEFAULT_PORT = 9876
|
||||
DEFAULT_LANGUAGE = "english"
|
||||
defaultStride = 10000
|
||||
defaultLanguage = "english"
|
||||
)
|
||||
|
||||
func usage() {
|
||||
@ -77,9 +76,9 @@ func makeTmpDir() (string, error) {
|
||||
func main() {
|
||||
var (
|
||||
format = flag.String("format", "", "dictionary format [edict|enamdict|epwing|kanjidic|rikai]")
|
||||
language = flag.String("language", DEFAULT_LANGUAGE, "dictionary language (if supported)")
|
||||
language = flag.String("language", defaultLanguage, "dictionary language (if supported)")
|
||||
title = flag.String("title", "", "dictionary title")
|
||||
stride = flag.Int("stride", DEFAULT_STRIDE, "dictionary bank stride")
|
||||
stride = flag.Int("stride", defaultStride, "dictionary bank stride")
|
||||
pretty = flag.Bool("pretty", false, "output prettified dictionary JSON")
|
||||
)
|
||||
|
||||
@ -89,10 +88,10 @@ func main() {
|
||||
if flag.NArg() != 2 {
|
||||
if err := gui(); err == nil {
|
||||
return
|
||||
} else {
|
||||
usage()
|
||||
os.Exit(2)
|
||||
}
|
||||
|
||||
usage()
|
||||
os.Exit(2)
|
||||
}
|
||||
|
||||
var (
|
||||
|
Loading…
Reference in New Issue
Block a user