1

Include entity tags in standalone forms dictionary

This commit is contained in:
stephenmk 2023-01-24 13:02:50 -06:00
parent 96358e3eb5
commit 406067eedd
No known key found for this signature in database
GPG Key ID: B6DA730DB06235F1

View File

@ -205,7 +205,7 @@ func formsExportDb(inputPath, outputPath, languageName, title string, stride int
} }
defer reader.Close() defer reader.Close()
dictionary, _, err := jmdict.LoadJmdictNoTransform(reader) dictionary, entities, err := jmdict.LoadJmdictNoTransform(reader)
if err != nil { if err != nil {
return err return err
} }
@ -231,13 +231,18 @@ func formsExportDb(inputPath, outputPath, languageName, title string, stride int
} }
} }
tags := dbTagList{}
tags = append(tags, entityTags(entities)...)
tags = append(tags, newsFrequencyTags()...)
tags = append(tags, customDbTags()...)
if title == "" { if title == "" {
title = "JMdict Forms" title = "JMdict Forms"
} }
recordData := map[string]dbRecordList{ recordData := map[string]dbRecordList{
"term": terms.crush(), "term": terms.crush(),
"tag": dbRecordList{}, "tag": tags.crush(),
} }
jmdictDate := jmdictPublicationDate(dictionary) jmdictDate := jmdictPublicationDate(dictionary)