aboutsummaryrefslogtreecommitdiff
path: root/ucd
diff options
context:
space:
mode:
Diffstat (limited to 'ucd')
-rw-r--r--ucd/api.go13
-rw-r--r--ucd/property.go14
2 files changed, 27 insertions, 0 deletions
diff --git a/ucd/api.go b/ucd/api.go
index 6451f39..0212e01 100644
--- a/ucd/api.go
+++ b/ucd/api.go
@@ -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