diff options
| author | 2024-03-26 21:53:04 -0400 | |
|---|---|---|
| committer | 2024-03-26 21:53:04 -0400 | |
| commit | 2d7959f03575e637d56924c14e2a37b54368953e (patch) | |
| tree | f4b9858b4c7223921d043111f06ee2758ad3c724 /src/Normalize.zig | |
| parent | Using diff for lowercase mapping (diff) | |
| download | zg-2d7959f03575e637d56924c14e2a37b54368953e.tar.gz zg-2d7959f03575e637d56924c14e2a37b54368953e.tar.xz zg-2d7959f03575e637d56924c14e2a37b54368953e.zip | |
GraphemeData and Normalize non-pub fns
Diffstat (limited to 'src/Normalize.zig')
| -rw-r--r-- | src/Normalize.zig | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Normalize.zig b/src/Normalize.zig index b5a54d1..6ef7c90 100644 --- a/src/Normalize.zig +++ b/src/Normalize.zig | |||
| @@ -91,8 +91,8 @@ const Decomp = struct { | |||
| 91 | cps: []const u21 = &.{}, | 91 | cps: []const u21 = &.{}, |
| 92 | }; | 92 | }; |
| 93 | 93 | ||
| 94 | /// `mapping` retrieves the decomposition mapping for a code point as per the UCD. | 94 | // `mapping` retrieves the decomposition mapping for a code point as per the UCD. |
| 95 | pub fn mapping(self: Self, cp: u21, form: Form) Decomp { | 95 | fn mapping(self: Self, cp: u21, form: Form) Decomp { |
| 96 | var dc = Decomp{}; | 96 | var dc = Decomp{}; |
| 97 | 97 | ||
| 98 | switch (form) { | 98 | switch (form) { |
| @@ -117,8 +117,8 @@ pub fn mapping(self: Self, cp: u21, form: Form) Decomp { | |||
| 117 | return dc; | 117 | return dc; |
| 118 | } | 118 | } |
| 119 | 119 | ||
| 120 | /// `decompose` a code point to the specified normalization form, which should be either `.nfd` or `.nfkd`. | 120 | // `decompose` a code point to the specified normalization form, which should be either `.nfd` or `.nfkd`. |
| 121 | pub fn decompose( | 121 | fn decompose( |
| 122 | self: Self, | 122 | self: Self, |
| 123 | cp: u21, | 123 | cp: u21, |
| 124 | form: Form, | 124 | form: Form, |
| @@ -587,8 +587,8 @@ fn getTrailCcc(self: Self, cp: u21) u8 { | |||
| 587 | return self.norm_data.ccc_data.ccc(dcp); | 587 | return self.norm_data.ccc_data.ccc(dcp); |
| 588 | } | 588 | } |
| 589 | 589 | ||
| 590 | /// Fast check to detect if a string is already in NFC or NFD form. | 590 | // Fast check to detect if a string is already in NFC or NFD form. |
| 591 | pub fn isFcd(self: Self, str: []const u8) bool { | 591 | fn isFcd(self: Self, str: []const u8) bool { |
| 592 | var prev_ccc: u8 = 0; | 592 | var prev_ccc: u8 = 0; |
| 593 | var cp_iter = CodePointIterator{ .bytes = str }; | 593 | var cp_iter = CodePointIterator{ .bytes = str }; |
| 594 | 594 | ||