1
This commit is contained in:
Alex Yatskov 2016-11-04 09:10:45 -07:00
parent a09898c0c5
commit 0bb8650934

View File

@ -189,22 +189,16 @@ func extractEdictTermMeta(edictEntry jmdict.JmdictEntry) []termMetaEntry {
}
func outputTermMetaJson(dir string, reader io.Reader, flags int) error {
// dict, entities, err := jmdict.LoadJmdictNoTransform(reader)
// if err != nil {
// return err
// }
// meta := make(map[string][]string)
// for _, entry := range dict.Entries {
// }
// var entries []termMetaEntry
// for _, entry := range dict.Entries {
// // defs = append(defs, convertEdictEntry(e)...)
// }
// index := newTermMetaIndex(entries, entities)
// return index.output(dir, flags&flagPrettyJson == flagPrettyJson)
return nil
dict, entities, err := jmdict.LoadJmdictNoTransform(reader)
if err != nil {
return err
}
var entries []termMetaEntry
for _, jmdictEntry := range dict.Entries {
entries = append(entries, extractEdictTermMeta(jmdictEntry)...)
}
index := newTermMetaIndex(entries, entities)
return index.output(dir, flags&flagPrettyJson == flagPrettyJson)
}