aboutsummaryrefslogtreecommitdiff
path: root/internal/norm/norm.go
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-09-14 21:39:00 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-09-14 21:39:00 +0200
commite0dddff176a01d410904b6750b3395de4f7e54db (patch)
treea0490057abfb75e89f7bd4559472717297cad823 /internal/norm/norm.go
parentd53c83e2fe6f1ecef006f116095fa8d1d18f3a7d (diff)
downloadkrino-e0dddff176a01d410904b6750b3395de4f7e54db.tar.gz
krino-e0dddff176a01d410904b6750b3395de4f7e54db.zip
plan 9: keyword cache keys on extension, max-read and Unicode tables, trims removed keywords
Diffstat (limited to 'internal/norm/norm.go')
-rw-r--r--internal/norm/norm.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/norm/norm.go b/internal/norm/norm.go
index 77bb604..701f765 100644
--- a/internal/norm/norm.go
+++ b/internal/norm/norm.go
@@ -5,6 +5,7 @@
package norm
import (
+ "fmt"
"strings"
"unicode"
@@ -16,6 +17,13 @@ import (
// another version are discarded (spec ยง6.1).
const Version = 1
+// Fingerprint names everything Text and Name's output depends on: Version,
+// and the Unicode tables of the standard library and of x/text's
+// normalisation, which a Go or x/text upgrade can change (review cache F4).
+func Fingerprint() string {
+ return fmt.Sprintf("norm%d unicode%s nfd%s", Version, unicode.Version, unorm.Version)
+}
+
// special holds the letters that do not decompose under Unicode NFD, so
// Fold maps them explicitly.
var special = map[rune]string{