diff options
Diffstat (limited to 'ucd')
-rw-r--r-- | ucd/api.go | 13 | ||||
-rw-r--r-- | ucd/property.go | 14 |
2 files changed, 27 insertions, 0 deletions
@@ -39,6 +39,19 @@ func NormalizeCharacterProperty(propName, propVal string) (string, error) { return b.String(), nil } +func IsContributoryProperty(propName string) bool { + if propName == "" { + return false + } + + for _, p := range contributoryProperties { + if propName == p { + return true + } + } + return false +} + func FindCodePointRanges(propName, propVal string) ([]*CodePointRange, bool, error) { if propName == "" { propName = "gc" diff --git a/ucd/property.go b/ucd/property.go index 71bbcad..0b2ac62 100644 --- a/ucd/property.go +++ b/ucd/property.go @@ -1,5 +1,19 @@ package ucd +// contributoryProperties is a set of contributory properties maleeni uses internally. Property statuses are +// defined in the following table. +// +// https://unicode.org/reports/tr44/#Property_List_Table +var contributoryProperties = []string{ + "oalpha", + "olower", + "oupper", +} + +func ContributoryProperties() []string { + return contributoryProperties +} + // https://www.unicode.org/reports/tr44/#GC_Values_Table var compositGeneralCategories = map[string][]string{ // Cased_Letter |