From cb9d92f0b4e0097579f6e5da1dc6e2f063b532a9 Mon Sep 17 00:00:00 2001 From: Ryo Nihei Date: Sun, 28 Nov 2021 00:37:03 +0900 Subject: Make contributory properties unavailable except internal use This change follows [UAX #44 5.13 Property APIs]. > The following subtypes of Unicode character properties should generally not be exposed in APIs, > except in limited circumstances. They may not be useful, particularly in public API collections, > and may instead prove misleading to the users of such API collections. > > * Contributory properties are not recommended for public APIs. > ... https://unicode.org/reports/tr44/#Property_APIs --- ucd/api.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'ucd/api.go') 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" -- cgit v1.2.3