diff options
author | Ryo Nihei <nihei.dev@gmail.com> | 2021-11-28 00:37:03 +0900 |
---|---|---|
committer | Ryo Nihei <nihei.dev@gmail.com> | 2021-11-28 13:53:18 +0900 |
commit | cb9d92f0b4e0097579f6e5da1dc6e2f063b532a9 (patch) | |
tree | 3d43aa9f3463f93451532d6dec9442a664d2d0a9 /ucd/api.go | |
parent | Move all UCD-related processes to ucd package (diff) | |
download | tre-cb9d92f0b4e0097579f6e5da1dc6e2f063b532a9.tar.gz tre-cb9d92f0b4e0097579f6e5da1dc6e2f063b532a9.tar.xz |
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
Diffstat (limited to 'ucd/api.go')
-rw-r--r-- | ucd/api.go | 13 |
1 files changed, 13 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" |