Documentation
¶
Overview ¶
Package ldml parses LDML documents containing either language-dependent data or supplementary data.
Note that this is not a full implementation.
Current features: * Parsing ldml>identity (incomplete). * Parsing ldml>rbnf rules.
TODO: ability to merge two documents with inheritance
see https://unicode.org/reports/tr35/#5-xml-format
Index ¶
Constants ¶
const ( DocTypeLdml = DocType("ldml") DocTypeSupplemental = DocType("supplementalData") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Document ¶
type PluralRule ¶
type PluralRules ¶
type PluralRules struct { Locales string `xml:"locales,attr"` Rules []PluralRule `xml:"pluralRule"` }
type Plurals ¶
type Plurals struct { Type string `xml:"type,attr"` Rules []PluralRules `xml:"pluralRules"` Ranges []TODO `xml:"pluralRanges"` }
type RbnfRule ¶
type RbnfRule struct { Value string `xml:"value,attr"` Radix string `xml:"radix,attr"` Content string `xml:",chardata"` }
func (RbnfRule) IcuStyle ¶
IcuStyle returns a rule formatted in the way described by the International Components for Unicode (ICU) software implementations ([ICU4C RuleBasedNumberFormat]) and ([ICU4J RuleBasedNumberFormat]), for example "name: body;".
ICU4C RuleBasedNumberFormat: https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/classicu_1_1RuleBasedNumberFormat.html ICU4J RuleBasedNumberFormat: https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/text/RuleBasedNumberFormat.html
type RbnfRuleset ¶
type RbnfRuleset struct { Type string `xml:"type,attr"` Rules []RbnfRule `xml:"rbnfrule"` Access string `xml:"access,attr"` }
func (RbnfRuleset) IsPrivate ¶
func (rs RbnfRuleset) IsPrivate() bool
type RbnfRulesetGrouping ¶
type RbnfRulesetGrouping struct { Type string `xml:"type,attr"` Rulesets []RbnfRuleset `xml:"ruleset"` }