From 200c617c865a5952f0bd12378802cc06ea3eb1c2 Mon Sep 17 00:00:00 2001 From: Jose Colon Rodriguez Date: Sun, 31 Mar 2024 09:59:51 -0400 Subject: Updated README --- src/CaseFold.zig | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/CaseFold.zig') diff --git a/src/CaseFold.zig b/src/CaseFold.zig index 9b10e16..3e7535e 100644 --- a/src/CaseFold.zig +++ b/src/CaseFold.zig @@ -10,7 +10,9 @@ fold_data: *const FoldData, const Self = @This(); -fn caseFold( +/// Produces the case folded code points for `cps`. Caller must free returned +/// slice with `allocator`. +pub fn caseFold( self: Self, allocator: mem.Allocator, cps: []const u21, @@ -37,6 +39,8 @@ fn changesWhenCaseFolded(self: Self, cps: []const u21) bool { } else false; } +/// Caseless compare `a` and `b` by decomposing to NFKD. This is the most +/// comprehensive comparison possible, but slower than `canonCaselessMatch`. pub fn compatCaselessMatch( self: Self, allocator: mem.Allocator, @@ -108,6 +112,8 @@ test "compatCaselessMatch" { try testing.expect(try caser.compatCaselessMatch(allocator, &n, a, c)); } +/// Performs canonical caseless string matching by decomposing to NFD. This is +/// faster than `compatCaselessMatch`, but less comprehensive. pub fn canonCaselessMatch( self: Self, allocator: mem.Allocator, -- cgit v1.2.3