summaryrefslogtreecommitdiff
path: root/src/CaseFold.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/CaseFold.zig')
-rw-r--r--src/CaseFold.zig8
1 files changed, 7 insertions, 1 deletions
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,
10 10
11const Self = @This(); 11const Self = @This();
12 12
13fn caseFold( 13/// Produces the case folded code points for `cps`. Caller must free returned
14/// slice with `allocator`.
15pub fn caseFold(
14 self: Self, 16 self: Self,
15 allocator: mem.Allocator, 17 allocator: mem.Allocator,
16 cps: []const u21, 18 cps: []const u21,
@@ -37,6 +39,8 @@ fn changesWhenCaseFolded(self: Self, cps: []const u21) bool {
37 } else false; 39 } else false;
38} 40}
39 41
42/// Caseless compare `a` and `b` by decomposing to NFKD. This is the most
43/// comprehensive comparison possible, but slower than `canonCaselessMatch`.
40pub fn compatCaselessMatch( 44pub fn compatCaselessMatch(
41 self: Self, 45 self: Self,
42 allocator: mem.Allocator, 46 allocator: mem.Allocator,
@@ -108,6 +112,8 @@ test "compatCaselessMatch" {
108 try testing.expect(try caser.compatCaselessMatch(allocator, &n, a, c)); 112 try testing.expect(try caser.compatCaselessMatch(allocator, &n, a, c));
109} 113}
110 114
115/// Performs canonical caseless string matching by decomposing to NFD. This is
116/// faster than `compatCaselessMatch`, but less comprehensive.
111pub fn canonCaselessMatch( 117pub fn canonCaselessMatch(
112 self: Self, 118 self: Self,
113 allocator: mem.Allocator, 119 allocator: mem.Allocator,