diff --git a/edict.go b/edict.go index 09a2aae..0fd3945 100644 --- a/edict.go +++ b/edict.go @@ -87,7 +87,7 @@ func convertEdictEntry(edictEntry jmdict.JmdictEntry) []vocabSource { return entries } -func processEdict(writer io.Writer, reader io.Reader, flags int) error { +func outputEdictJson(writer io.Writer, reader io.Reader, flags int) error { dict, entities, err := jmdict.LoadJmdictNoTransform(reader) if err != nil { return err diff --git a/enamdict.go b/enamdict.go index 9cf6336..71401f2 100644 --- a/enamdict.go +++ b/enamdict.go @@ -73,7 +73,7 @@ func convertJmnedictEntry(enamdictEntry jmdict.JmnedictEntry) []vocabSource { return entries } -func processJmnedict(writer io.Writer, reader io.Reader, flags int) error { +func outputJmnedictJson(writer io.Writer, reader io.Reader, flags int) error { dict, entities, err := jmdict.LoadJmnedictNoTransform(reader) if err != nil { return err diff --git a/kanjidic.go b/kanjidic.go index f2e93ce..793f153 100644 --- a/kanjidic.go +++ b/kanjidic.go @@ -139,7 +139,7 @@ func convertKanjidicCharacter(kanjidicCharacter jmdict.KanjidicCharacter) kanjiS return character } -func processKanjidic(writer io.Writer, reader io.Reader, flags int) error { +func outputKanjidicJson(writer io.Writer, reader io.Reader, flags int) error { dict, err := jmdict.LoadKanjidic(reader) if err != nil { return err diff --git a/main.go b/main.go index 66634de..4788f8c 100644 --- a/main.go +++ b/main.go @@ -42,11 +42,11 @@ func usage() { flag.PrintDefaults() } -func process(fileFormat, inputFile, outputFile string, flags int) error { +func outputJson(fileFormat, inputFile, outputFile string, flags int) error { handlers := map[string]func(io.Writer, io.Reader, int) error{ - "edict": processEdict, - "enamdict": processJmnedict, - "kanjidic": processKanjidic, + "edict": outputEdictJson, + "enamdict": outputJmnedictJson, + "kanjidic": outputKanjidicJson, } handler, ok := handlers[fileFormat] @@ -79,7 +79,7 @@ func main() { } if flag.NArg() == 3 { - if err := process(flag.Arg(0), flag.Arg(1), flag.Arg(2), flags); err != nil { + if err := outputJson(flag.Arg(0), flag.Arg(1), flag.Arg(2), flags); err != nil { log.Fatal(err) } } else {