summaryrefslogtreecommitdiff
path: root/src/Normalizer.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/Normalizer.zig')
-rw-r--r--src/Normalizer.zig9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Normalizer.zig b/src/Normalizer.zig
index d1d7cee..26177ac 100644
--- a/src/Normalizer.zig
+++ b/src/Normalizer.zig
@@ -6,8 +6,6 @@ const std = @import("std");
6const testing = std.testing; 6const testing = std.testing;
7 7
8const CodePointIterator = @import("code_point").Iterator; 8const CodePointIterator = @import("code_point").Iterator;
9const norm_props = @import("ziglyph").normalization_props;
10
11pub const NormData = @import("NormData"); 9pub const NormData = @import("NormData");
12 10
13norm_data: *NormData, 11norm_data: *NormData,
@@ -109,7 +107,10 @@ pub fn decompose(self: Self, cp: u21, form: Form) Decomp {
109 var dc = Decomp{ .form = form }; 107 var dc = Decomp{ .form = form };
110 108
111 // ASCII or NFD / NFKD quick checks. 109 // ASCII or NFD / NFKD quick checks.
112 if (cp <= 127 or (form == .nfd and norm_props.isNfd(cp)) or (form == .nfkd and norm_props.isNfkd(cp))) { 110 if (cp <= 127 or
111 (form == .nfd and self.norm_data.normp_data.isNfd(cp)) or
112 (form == .nfkd and self.norm_data.normp_data.isNfkd(cp)))
113 {
113 dc.cps[0] = cp; 114 dc.cps[0] = cp;
114 return dc; 115 return dc;
115 } 116 }
@@ -436,7 +437,7 @@ fn nfxc(self: Self, allocator: std.mem.Allocator, str: []const u8, form: Form) !
436 if (!processed_hangul) { 437 if (!processed_hangul) {
437 // L -> C not Hangul. 438 // L -> C not Hangul.
438 if (self.norm_data.canon_data.toNfc(.{ L, C })) |P| { 439 if (self.norm_data.canon_data.toNfc(.{ L, C })) |P| {
439 if (!norm_props.isFcx(P)) { 440 if (!self.norm_data.normp_data.isFcx(P)) {
440 d_list.items[sidx] = P; 441 d_list.items[sidx] = P;
441 d_list.items[i] = tombstone; // Mark for deletion. 442 d_list.items[i] = tombstone; // Mark for deletion.
442 deleted += 1; 443 deleted += 1;