package app

// short labels for the JMdict codes that show up most; the rest fall back
// to the dictionary's own descriptions.
var shortLabels = map[string]string{
	"n": "noun", "pn": "pronoun", "n-suf": "noun suffix", "n-pref": "noun prefix",
	"v1": "ichidan verb", "v1-s": "ichidan verb", "vs": "suru verb", "vs-i": "suru verb", "vs-s": "suru verb",
	"vk": "kuru verb", "vz": "zuru verb", "v5aru": "godan verb", "v5b": "godan verb", "v5g": "godan verb",
	"v5k": "godan verb", "v5k-s": "godan verb", "v5m": "godan verb", "v5n": "godan verb", "v5r": "godan verb",
	"v5r-i": "godan verb", "v5s": "godan verb", "v5t": "godan verb", "v5u": "godan verb", "v5u-s": "godan verb",
	"vt": "transitive", "vi": "intransitive", "aux-v": "auxiliary verb",
	"adj-i": "i-adjective", "adj-ix": "i-adjective (いい/よい)", "adj-na": "na-adjective", "adj-no": "takes の",
	"adj-pn": "pre-noun adjectival", "adj-t": "taru adjective", "adj-f": "prenominal",
	"adv": "adverb", "adv-to": "takes と", "prt": "particle", "conj": "conjunction", "int": "interjection",
	"exp": "expression", "ctr": "counter", "suf": "suffix", "pref": "prefix", "num": "numeric", "cop": "copula",
	"uk": "usually kana", "col": "colloquial", "hon": "honorific", "hum": "humble", "pol": "polite",
	"sl": "slang", "abbr": "abbreviation", "arch": "archaic", "fam": "familiar", "fem": "feminine",
	"male": "masculine", "vulg": "vulgar", "derog": "derogatory", "joc": "jocular", "on-mim": "onomatopoeia",
	"id": "idiom", "yoji": "yojijukugo", "obs": "obsolete", "rare": "rare", "chn": "children's language",
	"form": "formal", "poet": "poetic", "proverb": "proverb", "net-sl": "internet slang",
}

func (a *App) label(code string) string {
	if l, ok := shortLabels[code]; ok {
		return l
	}
	if a.dict != nil {
		if l := a.dict.TagLabel(code); l != "" {
			return l
		}
	}
	return code
}
