summaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/main.zig b/src/main.zig
index 57db05b..d1a0bb3 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -17,7 +17,7 @@ const std = @import("std");
17// const ascii = std.ascii; 17// const ascii = std.ascii;
18 18
19// const norm = @import("ziglyph").Normalizer; 19// const norm = @import("ziglyph").Normalizer;
20const Data = @import("Normalizer").Data; 20const NormData = @import("Normalizer").NormData;
21const norm = @import("Normalizer"); 21const norm = @import("Normalizer");
22 22
23pub fn main() !void { 23pub fn main() !void {
@@ -32,10 +32,9 @@ pub fn main() !void {
32 const input = try std.fs.cwd().readFileAlloc(allocator, in_path, std.math.maxInt(u32)); 32 const input = try std.fs.cwd().readFileAlloc(allocator, in_path, std.math.maxInt(u32));
33 defer allocator.free(input); 33 defer allocator.free(input);
34 34
35 var data = try Data.init(allocator); 35 var norm_data = try NormData.init(allocator);
36 defer data.deinit(); 36 defer norm_data.deinit();
37 37 var n = try norm.init(allocator, &norm_data);
38 var n = try norm.init(allocator, &data);
39 defer n.deinit(); 38 defer n.deinit();
40 // var n = try norm.init(allocator); 39 // var n = try norm.init(allocator);
41 // defer n.deinit(); 40 // defer n.deinit();
@@ -53,7 +52,7 @@ pub fn main() !void {
53 // while (iter.next()) |_| result += 1; 52 // while (iter.next()) |_| result += 1;
54 // while (iter.next()) |line| result += strWidth(line, &data); 53 // while (iter.next()) |line| result += strWidth(line, &data);
55 while (iter.next()) |line| { 54 while (iter.next()) |line| {
56 var nfc = try n.nfc(allocator, line); 55 var nfc = try n.nfd(allocator, line);
57 result += nfc.slice.len; 56 result += nfc.slice.len;
58 nfc.deinit(); 57 nfc.deinit();
59 } 58 }