1

Rename properties

This commit is contained in:
Alex Yatskov 2016-12-17 17:39:24 -08:00
parent d62e1cc2c0
commit f4d0746f3c
4 changed files with 13 additions and 13 deletions

View File

@ -32,9 +32,9 @@ import (
)
type dbTagMeta struct {
Notes string `json:"notes"`
Class string `json:"class"`
Order int `json:"order"`
Category string `json:"class"`
Notes string `json:"notes"`
Order int `json:"order"`
}
type dbTerm struct {

View File

@ -56,10 +56,10 @@ func computeJmdictScore(term *dbTerm) {
func computeJmdictTagMeta(entities map[string]string) map[string]dbTagMeta {
tags := map[string]dbTagMeta{
"news1": {Notes: "appears frequently in Mainichi Shimbun (top listing)", Class: "frequent", Order: 3},
"ichi1": {Notes: "listed as common in Ichimango Goi Bunruishuu (top listing)", Class: "frequent", Order: 3},
"spec1": {Notes: "common words not included in frequency lists (top listing)", Class: "frequent", Order: 3},
"gai1": {Notes: "common loanword (top listing)", Class: "frequent", Order: 3},
"news1": {Notes: "appears frequently in Mainichi Shimbun (top listing)", Category: "frequent", Order: 3},
"ichi1": {Notes: "listed as common in Ichimango Goi Bunruishuu (top listing)", Category: "frequent", Order: 3},
"spec1": {Notes: "common words not included in frequency lists (top listing)", Category: "frequent", Order: 3},
"gai1": {Notes: "common loanword (top listing)", Category: "frequent", Order: 3},
"news2": {Notes: "appears frequently in Mainichi Shimbun (bottom listing)", Order: 3},
"ichi2": {Notes: "listed as common in Ichimango Goi Bunruishuu (bottom listing)", Order: 3},
"spec2": {Notes: "common words not included in frequency lists (bottom listing)", Order: 3},
@ -71,13 +71,13 @@ func computeJmdictTagMeta(entities map[string]string) map[string]dbTagMeta {
switch name {
case "gai1", "ichi1", "news1", "spec1":
tag.Class = "frequent"
tag.Category = "frequent"
tag.Order = 1
case "exp", "id":
tag.Class = "expression"
tag.Category = "expression"
tag.Order = 2
case "arch", "iK":
tag.Class = "archaism"
tag.Category = "archaism"
tag.Order = 2
}

View File

@ -36,7 +36,7 @@ func computeJmnedictTagMeta(entities map[string]string) map[string]dbTagMeta {
switch name {
case "company", "fem", "given", "masc", "organization", "person", "place", "product", "station", "surname", "unclass", "work":
tag.Class = "name"
tag.Category = "name"
tag.Order = 4
}

View File

@ -90,8 +90,8 @@ func exportKanjidicDb(outputDir, title string, reader io.Reader, flags int) erro
}
tagMeta := map[string]dbTagMeta{
"jouyou": {Notes: "included in list of regular-use characters", Class: "frequent", Order: 3},
"jinmeiyou": {Notes: "included in list of characters for use in personal names", Class: "frequent", Order: 3},
"jouyou": {Notes: "included in list of regular-use characters", Category: "frequent", Order: 3},
"jinmeiyou": {Notes: "included in list of characters for use in personal names", Category: "frequent", Order: 3},
"jlpt": {Notes: "corresponding Japanese Language Proficiency Test level"},
"grade": {Notes: "school grade level at which the character is taught"},
"strokes": {Notes: "number of strokes needed to write the character"},