Documentation
¶
Index ¶
- func AccentTagMap() map[string]string
- func AudioLocalFilename(rawAudioField string) string
- func CanonicalizePOS(raw string) string
- func IsMultiword(headword string) bool
- func LabelAliasMap() map[string]LabelMapping
- func NormalizeAccentCode(rawTag string) string
- func NormalizeAudioAccentCode(rawAudioField string) (accentCode string, ok bool)
- func NormalizeHeadword(s string) string
- func NormalizeLabelAlias(raw string) (labelType, labelCode string, ok bool)
- func NormalizeTopic(topic string) (labelCode string, ok bool)
- func RawPOSToLearnerPOS() map[string]string
- func TopicToDomainMap() map[string]string
- type LabelMapping
- type ZhNormalizer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccentTagMap ¶
AccentTagMap returns a defensive copy of the frozen exact-tag accent mapping contract.
func AudioLocalFilename ¶
AudioLocalFilename defines the local MP3 cache filename contract only. Callers must pair the returned name with actual MP3 bytes, not renamed wav/ogg/oga payloads.
func CanonicalizePOS ¶
func IsMultiword ¶
func LabelAliasMap ¶
func LabelAliasMap() map[string]LabelMapping
LabelAliasMap returns a defensive copy of the frozen label alias mapping contract.
func NormalizeAccentCode ¶
NormalizeAccentCode keeps the commons baseline limited to single-tag exact and token-level matching.
func NormalizeAudioAccentCode ¶ added in v1.0.1
NormalizeAudioAccentCode infers a controlled accent code from high-confidence Wiktionary audio filename prefixes.
func NormalizeHeadword ¶
func NormalizeLabelAlias ¶
NormalizeLabelAlias resolves a raw label alias to its controlled label type/code.
func NormalizeTopic ¶
func RawPOSToLearnerPOS ¶
RawPOSToLearnerPOS returns a defensive copy of the frozen raw POS mapping contract.
func TopicToDomainMap ¶
TopicToDomainMap returns a defensive copy of the frozen topic-to-domain mapping contract.
Types ¶
type LabelMapping ¶
LabelMapping binds a raw label alias to a controlled label type/code pair.
func NormalizeLabelText ¶ added in v1.0.1
func NormalizeLabelText(raw string) []LabelMapping
NormalizeLabelText resolves a Wiktionary qualifier/raw_gloss label string to one or more controlled label mappings. Matches are allowlisted and ordered.
type ZhNormalizer ¶
type ZhNormalizer struct {
// contains filtered or unexported fields
}
func NewZhNormalizer ¶
func NewZhNormalizer() (*ZhNormalizer, error)
func (*ZhNormalizer) Normalize ¶
func (z *ZhNormalizer) Normalize(raw string) string