mittens 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile +1 -0
- data/README.md +2 -2
- data/Rakefile +10 -3
- data/lib/mittens/version.rb +1 -1
- data/vendor/snowball/.github/workflows/ci.yml +144 -17
- data/vendor/snowball/.github/workflows/coverage.yml +117 -0
- data/vendor/snowball/.github/workflows/runtime-tests.yml +26 -0
- data/vendor/snowball/.gitignore +33 -7
- data/vendor/snowball/CONTRIBUTING.rst +7 -0
- data/vendor/snowball/COPYING +1 -1
- data/vendor/snowball/GNUmakefile +736 -298
- data/vendor/snowball/NEWS +1394 -7
- data/vendor/snowball/README.rst +8 -8
- data/vendor/snowball/ada/generate/generate.adb +5 -5
- data/vendor/snowball/ada/src/stemmer.adb +177 -188
- data/vendor/snowball/ada/src/stemmer.ads +86 -89
- data/vendor/snowball/ada/src/stemwords.adb +21 -5
- data/vendor/snowball/algorithms/czech.sbl +255 -0
- data/vendor/snowball/algorithms/danish.sbl +22 -10
- data/vendor/snowball/algorithms/english.sbl +7 -4
- data/vendor/snowball/algorithms/esperanto.sbl +6 -7
- data/vendor/snowball/algorithms/estonian.sbl +9 -4
- data/vendor/snowball/algorithms/finnish.sbl +33 -21
- data/vendor/snowball/algorithms/german.sbl +5 -0
- data/vendor/snowball/algorithms/indonesian.sbl +115 -96
- data/vendor/snowball/algorithms/italian.sbl +26 -1
- data/vendor/snowball/algorithms/lithuanian.sbl +13 -13
- data/vendor/snowball/algorithms/norwegian.sbl +17 -6
- data/vendor/snowball/algorithms/persian.sbl +387 -0
- data/vendor/snowball/algorithms/polish.sbl +177 -0
- data/vendor/snowball/algorithms/sesotho.sbl +115 -0
- data/vendor/snowball/algorithms/turkish.sbl +4 -4
- data/vendor/snowball/compiler/analyser.c +2002 -711
- data/vendor/snowball/compiler/driver.c +460 -298
- data/vendor/snowball/compiler/generator.c +439 -1965
- data/vendor/snowball/compiler/generator_ada.c +605 -430
- data/vendor/snowball/compiler/generator_c.c +2227 -0
- data/vendor/snowball/compiler/generator_csharp.c +365 -274
- data/vendor/snowball/compiler/generator_dart.c +1476 -0
- data/vendor/snowball/compiler/generator_go.c +348 -270
- data/vendor/snowball/compiler/generator_java.c +330 -233
- data/vendor/snowball/compiler/generator_js.c +534 -385
- data/vendor/snowball/compiler/generator_pascal.c +361 -320
- data/vendor/snowball/compiler/generator_php.c +1445 -0
- data/vendor/snowball/compiler/generator_python.c +399 -299
- data/vendor/snowball/compiler/generator_rust.c +370 -261
- data/vendor/snowball/compiler/generator_zig.c +1474 -0
- data/vendor/snowball/compiler/header.h +153 -86
- data/vendor/snowball/compiler/space.c +121 -63
- data/vendor/snowball/compiler/tokeniser.c +286 -182
- data/vendor/snowball/compiler/tokens.h +71 -0
- data/vendor/snowball/csharp/Snowball/Among.cs +14 -26
- data/vendor/snowball/csharp/Snowball/AssemblyInfo.cs +3 -3
- data/vendor/snowball/csharp/Snowball/Stemmer.cs +41 -45
- data/vendor/snowball/csharp/Stemwords/Program.cs +20 -14
- data/vendor/snowball/cxx/.gitignore +4 -0
- data/vendor/snowball/cxx/generate_algorithms.pl +87 -0
- data/vendor/snowball/cxx/stemmer.h +12 -0
- data/vendor/snowball/cxx/stemwords.cxx +176 -0
- data/vendor/snowball/cxx/utilities.cxx +2 -0
- data/vendor/snowball/dart/.gitignore +4 -0
- data/vendor/snowball/dart/analysis_options.yaml +1 -0
- data/vendor/snowball/dart/example/test_app.dart +65 -0
- data/vendor/snowball/dart/generate_algorithms.pl +21 -0
- data/vendor/snowball/dart/lib/snowball.dart +18 -0
- data/vendor/snowball/dart/lib/src/snowball.dart +339 -0
- data/vendor/snowball/dart/pubspec.yaml +17 -0
- data/vendor/snowball/doc/libstemmer_dart_README +37 -0
- data/vendor/snowball/doc/libstemmer_js_README +2 -2
- data/vendor/snowball/doc/libstemmer_php_README +38 -0
- data/vendor/snowball/doc/libstemmer_python_README +3 -3
- data/vendor/snowball/examples/stemwords.c +18 -3
- data/vendor/snowball/go/README.md +12 -4
- data/vendor/snowball/go/env.go +12 -14
- data/vendor/snowball/go/stemwords/main.go +2 -1
- data/vendor/snowball/java/org/tartarus/snowball/CharArraySequence.java +36 -0
- data/vendor/snowball/java/org/tartarus/snowball/SnowballProgram.java +17 -34
- data/vendor/snowball/java/org/tartarus/snowball/SnowballStemmer.java +0 -2
- data/vendor/snowball/javascript/base-stemmer.js +219 -252
- data/vendor/snowball/javascript/stemwords.js +86 -58
- data/vendor/snowball/libstemmer/mkmodules.pl +1 -1
- data/vendor/snowball/libstemmer/modules.txt +4 -0
- data/vendor/snowball/pascal/SnowballProgram.pas +18 -31
- data/vendor/snowball/php/base-stemmer.php +453 -0
- data/vendor/snowball/php/stemwords.php +25 -0
- data/vendor/snowball/python/create_init.py +16 -21
- data/vendor/snowball/python/pyproject.toml +3 -0
- data/vendor/snowball/python/setup.py +5 -7
- data/vendor/snowball/python/snowballstemmer/among.py +1 -2
- data/vendor/snowball/python/snowballstemmer/basestemmer.py +24 -33
- data/vendor/snowball/python/stemwords.py +72 -63
- data/vendor/snowball/runtime/api.c +11 -42
- data/vendor/snowball/runtime/api.h +11 -9
- data/vendor/snowball/runtime/snowball_runtime.h +110 -0
- data/vendor/snowball/runtime/utilities.c +282 -106
- data/vendor/snowball/rust/src/main.rs +2 -2
- data/vendor/snowball/rust/src/snowball/snowball_env.rs +7 -9
- data/vendor/snowball/tests/compilertest +62 -0
- data/vendor/snowball/tests/errors/ae-errors.sbl +53 -0
- data/vendor/snowball/tests/errors/ae-errors.stderr +8 -0
- data/vendor/snowball/tests/errors/bad-dollar.sbl +14 -0
- data/vendor/snowball/tests/errors/bad-dollar.stderr +4 -0
- data/vendor/snowball/tests/errors/bad-grouping-definition.sbl +9 -0
- data/vendor/snowball/tests/errors/bad-grouping-definition.stderr +6 -0
- data/vendor/snowball/tests/errors/missing-bra.sbl +6 -0
- data/vendor/snowball/tests/errors/missing-bra.stderr +3 -0
- data/vendor/snowball/tests/errors/missing-command.sbl +9 -0
- data/vendor/snowball/tests/errors/missing-command.stderr +1 -0
- data/vendor/snowball/tests/errors/missing-ket-backwardmode.sbl +3 -0
- data/vendor/snowball/tests/errors/missing-ket-backwardmode.stderr +1 -0
- data/vendor/snowball/tests/errors/missing-ket.sbl +7 -0
- data/vendor/snowball/tests/errors/missing-ket.stderr +6 -0
- data/vendor/snowball/tests/errors/notdefined.sbl +4 -0
- data/vendor/snowball/tests/errors/notdefined.stderr +2 -0
- data/vendor/snowball/tests/errors/string-omitted.sbl +5 -0
- data/vendor/snowball/tests/errors/string-omitted.stderr +1 -0
- data/vendor/snowball/tests/errors/undeclared.sbl +20 -0
- data/vendor/snowball/tests/errors/undeclared.stderr +9 -0
- data/vendor/snowball/tests/errors/unexpected-token.sbl +24 -0
- data/vendor/snowball/tests/errors/unexpected-token.stderr +17 -0
- data/vendor/snowball/tests/errors/wrongdirection.sbl +14 -0
- data/vendor/snowball/tests/errors/wrongdirection.stderr +1 -0
- data/vendor/snowball/tests/runtime/among.sbl +19 -0
- data/vendor/snowball/tests/runtime/arithmeticexpr.sbl +86 -0
- data/vendor/snowball/tests/runtime/attachinsert.sbl +47 -0
- data/vendor/snowball/tests/runtime/booleans.sbl +19 -0
- data/vendor/snowball/tests/runtime/externals.sbl +22 -0
- data/vendor/snowball/tests/runtime/hop.sbl +12 -0
- data/vendor/snowball/tests/runtime/integertests.sbl +60 -0
- data/vendor/snowball/tests/runtime/intlimits.sbl +25 -0
- data/vendor/snowball/tests/runtime/naming.sbl +20 -0
- data/vendor/snowball/tests/runtime/not.sbl +30 -0
- data/vendor/snowball/tests/runtime/or.sbl +17 -0
- data/vendor/snowball/tests/runtime/repeat.sbl +16 -0
- data/vendor/snowball/tests/runtime/setlimit.sbl +24 -0
- data/vendor/snowball/tests/runtime/sizelen.sbl +56 -0
- data/vendor/snowball/tests/runtime/slice.sbl +27 -0
- data/vendor/snowball/tests/runtime/stringdollar.sbl +39 -0
- data/vendor/snowball/tests/runtime/strings.sbl +66 -0
- data/vendor/snowball/tests/runtime/test.sbl +19 -0
- data/vendor/snowball/tests/stemtest.c +41 -1
- data/vendor/snowball/tests/syntax/canon.sbl +32 -0
- data/vendor/snowball/tests/syntax/canon.stderr +0 -0
- data/vendor/snowball/tests/syntax/canon.syntax +57 -0
- data/vendor/snowball/tests/syntax/emptyprogram.sbl +2 -0
- data/vendor/snowball/tests/syntax/emptyprogram.syntax +0 -0
- data/vendor/snowball/tests/syntax/groupings.sbl +11 -0
- data/vendor/snowball/tests/syntax/inline.sbl +144 -0
- data/vendor/snowball/tests/syntax/inline.stderr +0 -0
- data/vendor/snowball/tests/syntax/inline.syntax +121 -0
- data/vendor/snowball/tests/syntax/legacy.sbl +17 -0
- data/vendor/snowball/tests/syntax/legacy.stderr +5 -0
- data/vendor/snowball/tests/syntax/legacy.syntax +19 -0
- data/vendor/snowball/tests/syntax/loops.sbl +14 -0
- data/vendor/snowball/tests/syntax/loops.stderr +9 -0
- data/vendor/snowball/tests/syntax/loops.syntax +29 -0
- data/vendor/snowball/tests/syntax/noops.sbl +76 -0
- data/vendor/snowball/tests/syntax/noops.stderr +27 -0
- data/vendor/snowball/tests/syntax/noops.syntax +135 -0
- data/vendor/snowball/tests/syntax/simplifyae.sbl +21 -0
- data/vendor/snowball/tests/syntax/simplifyae.stderr +0 -0
- data/vendor/snowball/tests/syntax/simplifyae.syntax +39 -0
- data/vendor/snowball/tests/syntax/unused.sbl +18 -0
- data/vendor/snowball/tests/syntax/unused.stderr +7 -0
- data/vendor/snowball/tests/syntax/unused.syntax +3 -0
- data/vendor/snowball/zig/env.zig +599 -0
- data/vendor/snowball/zig/generate_algorithms.pl +19 -0
- data/vendor/snowball/zig/stemwords.zig +123 -0
- metadata +102 -4
- data/vendor/snowball/compiler/syswords.h +0 -86
- data/vendor/snowball/runtime/header.h +0 -62
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
const std = @import("std");
|
|
2
|
+
const snowball = @import("env.zig");
|
|
3
|
+
const alg = @import("algorithms.zig");
|
|
4
|
+
|
|
5
|
+
fn findStemmer(name: []const u8) ?alg.StemFn {
|
|
6
|
+
for (alg.algorithms) |a| {
|
|
7
|
+
if (std.mem.eql(u8, a.name, name)) return a.stem;
|
|
8
|
+
}
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
fn readFile(io: std.Io, allocator: std.mem.Allocator, path: []const u8) ![]u8 {
|
|
13
|
+
const file = try std.Io.Dir.cwd().openFile(io, path, .{});
|
|
14
|
+
defer file.close(io);
|
|
15
|
+
const stat = try file.stat(io);
|
|
16
|
+
const size: usize = @intCast(stat.size);
|
|
17
|
+
const buf = try allocator.alloc(u8, size);
|
|
18
|
+
errdefer allocator.free(buf);
|
|
19
|
+
const n = try file.readPositionalAll(io, buf, 0);
|
|
20
|
+
return buf[0..n];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
fn writeFile(io: std.Io, path: []const u8, data: []const u8) !void {
|
|
24
|
+
const file = try std.Io.Dir.cwd().createFile(io, path, .{});
|
|
25
|
+
defer file.close(io);
|
|
26
|
+
try file.writePositionalAll(io, data, 0);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
pub fn main(init: std.process.Init) !void {
|
|
30
|
+
const io = init.io;
|
|
31
|
+
const allocator = init.gpa;
|
|
32
|
+
|
|
33
|
+
var args_iter = std.process.Args.Iterator.init(init.minimal.args);
|
|
34
|
+
_ = args_iter.next(); // skip program name
|
|
35
|
+
|
|
36
|
+
var language: ?[]const u8 = null;
|
|
37
|
+
var input_path: ?[]const u8 = null;
|
|
38
|
+
var output_path: ?[]const u8 = null;
|
|
39
|
+
|
|
40
|
+
while (args_iter.next()) |arg| {
|
|
41
|
+
if (std.mem.eql(u8, arg, "-l")) {
|
|
42
|
+
language = args_iter.next();
|
|
43
|
+
} else if (std.mem.eql(u8, arg, "-i")) {
|
|
44
|
+
input_path = args_iter.next();
|
|
45
|
+
} else if (std.mem.eql(u8, arg, "-o")) {
|
|
46
|
+
output_path = args_iter.next();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const lang = language orelse std.process.fatal("error: -l language required", .{});
|
|
51
|
+
const stem_fn = findStemmer(lang) orelse
|
|
52
|
+
std.process.fatal("error: unknown language '{s}'", .{lang});
|
|
53
|
+
|
|
54
|
+
var env = snowball.Env.init(allocator);
|
|
55
|
+
defer env.deinit();
|
|
56
|
+
|
|
57
|
+
if (input_path) |p| {
|
|
58
|
+
// File input: read all, process, write all
|
|
59
|
+
const input_data = try readFile(io, allocator, p);
|
|
60
|
+
defer allocator.free(input_data);
|
|
61
|
+
|
|
62
|
+
var output = std.ArrayList(u8).initCapacity(allocator, input_data.len) catch
|
|
63
|
+
std.process.fatal("out of memory", .{});
|
|
64
|
+
defer output.deinit(allocator);
|
|
65
|
+
|
|
66
|
+
var rest = input_data;
|
|
67
|
+
while (std.mem.indexOfScalar(u8, rest, '\n')) |nl| {
|
|
68
|
+
const line = rest[0..nl];
|
|
69
|
+
if (line.len > 0) {
|
|
70
|
+
try env.setCurrent(line);
|
|
71
|
+
_ = stem_fn(&env);
|
|
72
|
+
output.appendSlice(allocator, env.getCurrent()) catch
|
|
73
|
+
std.process.fatal("out of memory", .{});
|
|
74
|
+
}
|
|
75
|
+
output.append(allocator, '\n') catch
|
|
76
|
+
std.process.fatal("out of memory", .{});
|
|
77
|
+
rest = rest[nl + 1 ..];
|
|
78
|
+
}
|
|
79
|
+
if (rest.len > 0) {
|
|
80
|
+
try env.setCurrent(rest);
|
|
81
|
+
_ = stem_fn(&env);
|
|
82
|
+
output.appendSlice(allocator, env.getCurrent()) catch
|
|
83
|
+
std.process.fatal("out of memory", .{});
|
|
84
|
+
output.append(allocator, '\n') catch
|
|
85
|
+
std.process.fatal("out of memory", .{});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (output_path) |out_path| {
|
|
89
|
+
try writeFile(io, out_path, output.items);
|
|
90
|
+
} else {
|
|
91
|
+
var write_buf: [8192]u8 = undefined;
|
|
92
|
+
var writer = std.Io.File.stdout().writerStreaming(io, &write_buf);
|
|
93
|
+
try writer.interface.writeAll(output.items);
|
|
94
|
+
try writer.interface.flush();
|
|
95
|
+
}
|
|
96
|
+
} else {
|
|
97
|
+
// Stdin: process line by line, stream output
|
|
98
|
+
var read_buf: [8192]u8 = undefined;
|
|
99
|
+
var reader = std.Io.File.stdin().readerStreaming(io, &read_buf);
|
|
100
|
+
|
|
101
|
+
const out_file = if (output_path) |out_path|
|
|
102
|
+
try std.Io.Dir.cwd().createFile(io, out_path, .{})
|
|
103
|
+
else
|
|
104
|
+
null;
|
|
105
|
+
defer if (out_file) |f| f.close(io);
|
|
106
|
+
|
|
107
|
+
var write_buf: [8192]u8 = undefined;
|
|
108
|
+
var writer = if (out_file) |f|
|
|
109
|
+
f.writerStreaming(io, &write_buf)
|
|
110
|
+
else
|
|
111
|
+
std.Io.File.stdout().writerStreaming(io, &write_buf);
|
|
112
|
+
|
|
113
|
+
while (try reader.interface.takeDelimiter('\n')) |line| {
|
|
114
|
+
if (line.len > 0) {
|
|
115
|
+
try env.setCurrent(line);
|
|
116
|
+
_ = stem_fn(&env);
|
|
117
|
+
try writer.interface.writeAll(env.getCurrent());
|
|
118
|
+
}
|
|
119
|
+
try writer.interface.writeByte('\n');
|
|
120
|
+
}
|
|
121
|
+
try writer.interface.flush();
|
|
122
|
+
}
|
|
123
|
+
}
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mittens
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andrew Kane
|
|
@@ -26,6 +26,8 @@ files:
|
|
|
26
26
|
- lib/mittens/version.rb
|
|
27
27
|
- mittens.gemspec
|
|
28
28
|
- vendor/snowball/.github/workflows/ci.yml
|
|
29
|
+
- vendor/snowball/.github/workflows/coverage.yml
|
|
30
|
+
- vendor/snowball/.github/workflows/runtime-tests.yml
|
|
29
31
|
- vendor/snowball/.gitignore
|
|
30
32
|
- vendor/snowball/AUTHORS
|
|
31
33
|
- vendor/snowball/CONTRIBUTING.rst
|
|
@@ -45,6 +47,7 @@ files:
|
|
|
45
47
|
- vendor/snowball/algorithms/armenian.sbl
|
|
46
48
|
- vendor/snowball/algorithms/basque.sbl
|
|
47
49
|
- vendor/snowball/algorithms/catalan.sbl
|
|
50
|
+
- vendor/snowball/algorithms/czech.sbl
|
|
48
51
|
- vendor/snowball/algorithms/danish.sbl
|
|
49
52
|
- vendor/snowball/algorithms/dutch.sbl
|
|
50
53
|
- vendor/snowball/algorithms/dutch_porter.sbl
|
|
@@ -64,11 +67,14 @@ files:
|
|
|
64
67
|
- vendor/snowball/algorithms/lovins.sbl
|
|
65
68
|
- vendor/snowball/algorithms/nepali.sbl
|
|
66
69
|
- vendor/snowball/algorithms/norwegian.sbl
|
|
70
|
+
- vendor/snowball/algorithms/persian.sbl
|
|
71
|
+
- vendor/snowball/algorithms/polish.sbl
|
|
67
72
|
- vendor/snowball/algorithms/porter.sbl
|
|
68
73
|
- vendor/snowball/algorithms/portuguese.sbl
|
|
69
74
|
- vendor/snowball/algorithms/romanian.sbl
|
|
70
75
|
- vendor/snowball/algorithms/russian.sbl
|
|
71
76
|
- vendor/snowball/algorithms/serbian.sbl
|
|
77
|
+
- vendor/snowball/algorithms/sesotho.sbl
|
|
72
78
|
- vendor/snowball/algorithms/spanish.sbl
|
|
73
79
|
- vendor/snowball/algorithms/swedish.sbl
|
|
74
80
|
- vendor/snowball/algorithms/tamil.sbl
|
|
@@ -81,17 +87,21 @@ files:
|
|
|
81
87
|
- vendor/snowball/compiler/driver.c
|
|
82
88
|
- vendor/snowball/compiler/generator.c
|
|
83
89
|
- vendor/snowball/compiler/generator_ada.c
|
|
90
|
+
- vendor/snowball/compiler/generator_c.c
|
|
84
91
|
- vendor/snowball/compiler/generator_csharp.c
|
|
92
|
+
- vendor/snowball/compiler/generator_dart.c
|
|
85
93
|
- vendor/snowball/compiler/generator_go.c
|
|
86
94
|
- vendor/snowball/compiler/generator_java.c
|
|
87
95
|
- vendor/snowball/compiler/generator_js.c
|
|
88
96
|
- vendor/snowball/compiler/generator_pascal.c
|
|
97
|
+
- vendor/snowball/compiler/generator_php.c
|
|
89
98
|
- vendor/snowball/compiler/generator_python.c
|
|
90
99
|
- vendor/snowball/compiler/generator_rust.c
|
|
100
|
+
- vendor/snowball/compiler/generator_zig.c
|
|
91
101
|
- vendor/snowball/compiler/header.h
|
|
92
102
|
- vendor/snowball/compiler/space.c
|
|
93
|
-
- vendor/snowball/compiler/syswords.h
|
|
94
103
|
- vendor/snowball/compiler/tokeniser.c
|
|
104
|
+
- vendor/snowball/compiler/tokens.h
|
|
95
105
|
- vendor/snowball/csharp/.gitignore
|
|
96
106
|
- vendor/snowball/csharp/Snowball/Algorithms/.gitignore
|
|
97
107
|
- vendor/snowball/csharp/Snowball/Among.cs
|
|
@@ -99,11 +109,25 @@ files:
|
|
|
99
109
|
- vendor/snowball/csharp/Snowball/Stemmer.cs
|
|
100
110
|
- vendor/snowball/csharp/Stemwords/App.config
|
|
101
111
|
- vendor/snowball/csharp/Stemwords/Program.cs
|
|
112
|
+
- vendor/snowball/cxx/.gitignore
|
|
113
|
+
- vendor/snowball/cxx/generate_algorithms.pl
|
|
114
|
+
- vendor/snowball/cxx/stemmer.h
|
|
115
|
+
- vendor/snowball/cxx/stemwords.cxx
|
|
116
|
+
- vendor/snowball/cxx/utilities.cxx
|
|
117
|
+
- vendor/snowball/dart/.gitignore
|
|
118
|
+
- vendor/snowball/dart/analysis_options.yaml
|
|
119
|
+
- vendor/snowball/dart/example/test_app.dart
|
|
120
|
+
- vendor/snowball/dart/generate_algorithms.pl
|
|
121
|
+
- vendor/snowball/dart/lib/snowball.dart
|
|
122
|
+
- vendor/snowball/dart/lib/src/snowball.dart
|
|
123
|
+
- vendor/snowball/dart/pubspec.yaml
|
|
102
124
|
- vendor/snowball/doc/TODO
|
|
103
125
|
- vendor/snowball/doc/libstemmer_c_README
|
|
104
126
|
- vendor/snowball/doc/libstemmer_csharp_README
|
|
127
|
+
- vendor/snowball/doc/libstemmer_dart_README
|
|
105
128
|
- vendor/snowball/doc/libstemmer_java_README
|
|
106
129
|
- vendor/snowball/doc/libstemmer_js_README
|
|
130
|
+
- vendor/snowball/doc/libstemmer_php_README
|
|
107
131
|
- vendor/snowball/doc/libstemmer_python_README
|
|
108
132
|
- vendor/snowball/examples/stemwords.c
|
|
109
133
|
- vendor/snowball/go/README.md
|
|
@@ -115,6 +139,7 @@ files:
|
|
|
115
139
|
- vendor/snowball/iconv.py
|
|
116
140
|
- vendor/snowball/include/libstemmer.h
|
|
117
141
|
- vendor/snowball/java/org/tartarus/snowball/Among.java
|
|
142
|
+
- vendor/snowball/java/org/tartarus/snowball/CharArraySequence.java
|
|
118
143
|
- vendor/snowball/java/org/tartarus/snowball/SnowballProgram.java
|
|
119
144
|
- vendor/snowball/java/org/tartarus/snowball/SnowballStemmer.java
|
|
120
145
|
- vendor/snowball/java/org/tartarus/snowball/TestApp.java
|
|
@@ -129,8 +154,11 @@ files:
|
|
|
129
154
|
- vendor/snowball/pascal/SnowballProgram.pas
|
|
130
155
|
- vendor/snowball/pascal/generate.pl
|
|
131
156
|
- vendor/snowball/pascal/stemwords-template.dpr
|
|
157
|
+
- vendor/snowball/php/base-stemmer.php
|
|
158
|
+
- vendor/snowball/php/stemwords.php
|
|
132
159
|
- vendor/snowball/python/MANIFEST.in
|
|
133
160
|
- vendor/snowball/python/create_init.py
|
|
161
|
+
- vendor/snowball/python/pyproject.toml
|
|
134
162
|
- vendor/snowball/python/setup.cfg
|
|
135
163
|
- vendor/snowball/python/setup.py
|
|
136
164
|
- vendor/snowball/python/snowballstemmer/among.py
|
|
@@ -139,7 +167,7 @@ files:
|
|
|
139
167
|
- vendor/snowball/python/testapp.py
|
|
140
168
|
- vendor/snowball/runtime/api.c
|
|
141
169
|
- vendor/snowball/runtime/api.h
|
|
142
|
-
- vendor/snowball/runtime/
|
|
170
|
+
- vendor/snowball/runtime/snowball_runtime.h
|
|
143
171
|
- vendor/snowball/runtime/utilities.c
|
|
144
172
|
- vendor/snowball/rust/Cargo.toml
|
|
145
173
|
- vendor/snowball/rust/build.rs
|
|
@@ -149,7 +177,77 @@ files:
|
|
|
149
177
|
- vendor/snowball/rust/src/snowball/among.rs
|
|
150
178
|
- vendor/snowball/rust/src/snowball/mod.rs
|
|
151
179
|
- vendor/snowball/rust/src/snowball/snowball_env.rs
|
|
180
|
+
- vendor/snowball/tests/compilertest
|
|
181
|
+
- vendor/snowball/tests/errors/ae-errors.sbl
|
|
182
|
+
- vendor/snowball/tests/errors/ae-errors.stderr
|
|
183
|
+
- vendor/snowball/tests/errors/bad-dollar.sbl
|
|
184
|
+
- vendor/snowball/tests/errors/bad-dollar.stderr
|
|
185
|
+
- vendor/snowball/tests/errors/bad-grouping-definition.sbl
|
|
186
|
+
- vendor/snowball/tests/errors/bad-grouping-definition.stderr
|
|
187
|
+
- vendor/snowball/tests/errors/missing-bra.sbl
|
|
188
|
+
- vendor/snowball/tests/errors/missing-bra.stderr
|
|
189
|
+
- vendor/snowball/tests/errors/missing-command.sbl
|
|
190
|
+
- vendor/snowball/tests/errors/missing-command.stderr
|
|
191
|
+
- vendor/snowball/tests/errors/missing-ket-backwardmode.sbl
|
|
192
|
+
- vendor/snowball/tests/errors/missing-ket-backwardmode.stderr
|
|
193
|
+
- vendor/snowball/tests/errors/missing-ket.sbl
|
|
194
|
+
- vendor/snowball/tests/errors/missing-ket.stderr
|
|
195
|
+
- vendor/snowball/tests/errors/notdefined.sbl
|
|
196
|
+
- vendor/snowball/tests/errors/notdefined.stderr
|
|
197
|
+
- vendor/snowball/tests/errors/string-omitted.sbl
|
|
198
|
+
- vendor/snowball/tests/errors/string-omitted.stderr
|
|
199
|
+
- vendor/snowball/tests/errors/undeclared.sbl
|
|
200
|
+
- vendor/snowball/tests/errors/undeclared.stderr
|
|
201
|
+
- vendor/snowball/tests/errors/unexpected-token.sbl
|
|
202
|
+
- vendor/snowball/tests/errors/unexpected-token.stderr
|
|
203
|
+
- vendor/snowball/tests/errors/wrongdirection.sbl
|
|
204
|
+
- vendor/snowball/tests/errors/wrongdirection.stderr
|
|
205
|
+
- vendor/snowball/tests/runtime/among.sbl
|
|
206
|
+
- vendor/snowball/tests/runtime/arithmeticexpr.sbl
|
|
207
|
+
- vendor/snowball/tests/runtime/attachinsert.sbl
|
|
208
|
+
- vendor/snowball/tests/runtime/booleans.sbl
|
|
209
|
+
- vendor/snowball/tests/runtime/externals.sbl
|
|
210
|
+
- vendor/snowball/tests/runtime/hop.sbl
|
|
211
|
+
- vendor/snowball/tests/runtime/integertests.sbl
|
|
212
|
+
- vendor/snowball/tests/runtime/intlimits.sbl
|
|
213
|
+
- vendor/snowball/tests/runtime/naming.sbl
|
|
214
|
+
- vendor/snowball/tests/runtime/not.sbl
|
|
215
|
+
- vendor/snowball/tests/runtime/or.sbl
|
|
216
|
+
- vendor/snowball/tests/runtime/repeat.sbl
|
|
217
|
+
- vendor/snowball/tests/runtime/setlimit.sbl
|
|
218
|
+
- vendor/snowball/tests/runtime/sizelen.sbl
|
|
219
|
+
- vendor/snowball/tests/runtime/slice.sbl
|
|
220
|
+
- vendor/snowball/tests/runtime/stringdollar.sbl
|
|
221
|
+
- vendor/snowball/tests/runtime/strings.sbl
|
|
222
|
+
- vendor/snowball/tests/runtime/test.sbl
|
|
152
223
|
- vendor/snowball/tests/stemtest.c
|
|
224
|
+
- vendor/snowball/tests/syntax/canon.sbl
|
|
225
|
+
- vendor/snowball/tests/syntax/canon.stderr
|
|
226
|
+
- vendor/snowball/tests/syntax/canon.syntax
|
|
227
|
+
- vendor/snowball/tests/syntax/emptyprogram.sbl
|
|
228
|
+
- vendor/snowball/tests/syntax/emptyprogram.syntax
|
|
229
|
+
- vendor/snowball/tests/syntax/groupings.sbl
|
|
230
|
+
- vendor/snowball/tests/syntax/inline.sbl
|
|
231
|
+
- vendor/snowball/tests/syntax/inline.stderr
|
|
232
|
+
- vendor/snowball/tests/syntax/inline.syntax
|
|
233
|
+
- vendor/snowball/tests/syntax/legacy.sbl
|
|
234
|
+
- vendor/snowball/tests/syntax/legacy.stderr
|
|
235
|
+
- vendor/snowball/tests/syntax/legacy.syntax
|
|
236
|
+
- vendor/snowball/tests/syntax/loops.sbl
|
|
237
|
+
- vendor/snowball/tests/syntax/loops.stderr
|
|
238
|
+
- vendor/snowball/tests/syntax/loops.syntax
|
|
239
|
+
- vendor/snowball/tests/syntax/noops.sbl
|
|
240
|
+
- vendor/snowball/tests/syntax/noops.stderr
|
|
241
|
+
- vendor/snowball/tests/syntax/noops.syntax
|
|
242
|
+
- vendor/snowball/tests/syntax/simplifyae.sbl
|
|
243
|
+
- vendor/snowball/tests/syntax/simplifyae.stderr
|
|
244
|
+
- vendor/snowball/tests/syntax/simplifyae.syntax
|
|
245
|
+
- vendor/snowball/tests/syntax/unused.sbl
|
|
246
|
+
- vendor/snowball/tests/syntax/unused.stderr
|
|
247
|
+
- vendor/snowball/tests/syntax/unused.syntax
|
|
248
|
+
- vendor/snowball/zig/env.zig
|
|
249
|
+
- vendor/snowball/zig/generate_algorithms.pl
|
|
250
|
+
- vendor/snowball/zig/stemwords.zig
|
|
153
251
|
homepage: https://github.com/ankane/mittens
|
|
154
252
|
licenses:
|
|
155
253
|
- BSD-3-Clause
|
|
@@ -168,7 +266,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
168
266
|
- !ruby/object:Gem::Version
|
|
169
267
|
version: '0'
|
|
170
268
|
requirements: []
|
|
171
|
-
rubygems_version:
|
|
269
|
+
rubygems_version: 4.0.14
|
|
172
270
|
specification_version: 4
|
|
173
271
|
summary: Stemming for Ruby, powered by Snowball
|
|
174
272
|
test_files: []
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
static const struct system_word vocab[82+1] = {
|
|
2
|
-
{ 0, (const byte *)"", 82+1},
|
|
3
|
-
|
|
4
|
-
{ 1, (const byte *)"$", c_dollar },
|
|
5
|
-
{ 1, (const byte *)"(", c_bra },
|
|
6
|
-
{ 1, (const byte *)")", c_ket },
|
|
7
|
-
{ 1, (const byte *)"*", c_multiply },
|
|
8
|
-
{ 1, (const byte *)"+", c_plus },
|
|
9
|
-
{ 1, (const byte *)"-", c_minus },
|
|
10
|
-
{ 1, (const byte *)"/", c_divide },
|
|
11
|
-
{ 1, (const byte *)"<", c_lt },
|
|
12
|
-
{ 1, (const byte *)"=", c_assign },
|
|
13
|
-
{ 1, (const byte *)">", c_gt },
|
|
14
|
-
{ 1, (const byte *)"?", c_debug },
|
|
15
|
-
{ 1, (const byte *)"[", c_leftslice },
|
|
16
|
-
{ 1, (const byte *)"]", c_rightslice },
|
|
17
|
-
{ 2, (const byte *)"!=", c_ne },
|
|
18
|
-
{ 2, (const byte *)"*=", c_multiplyassign },
|
|
19
|
-
{ 2, (const byte *)"+=", c_plusassign },
|
|
20
|
-
{ 2, (const byte *)"-=", c_minusassign },
|
|
21
|
-
{ 2, (const byte *)"->", c_sliceto },
|
|
22
|
-
{ 2, (const byte *)"/*", c_comment2 },
|
|
23
|
-
{ 2, (const byte *)"//", c_comment1 },
|
|
24
|
-
{ 2, (const byte *)"/=", c_divideassign },
|
|
25
|
-
{ 2, (const byte *)"<+", c_insert },
|
|
26
|
-
{ 2, (const byte *)"<-", c_slicefrom },
|
|
27
|
-
{ 2, (const byte *)"<=", c_le },
|
|
28
|
-
{ 2, (const byte *)"==", c_eq },
|
|
29
|
-
{ 2, (const byte *)"=>", c_assignto },
|
|
30
|
-
{ 2, (const byte *)">=", c_ge },
|
|
31
|
-
{ 2, (const byte *)"as", c_as },
|
|
32
|
-
{ 2, (const byte *)"do", c_do },
|
|
33
|
-
{ 2, (const byte *)"or", c_or },
|
|
34
|
-
{ 3, (const byte *)"and", c_and },
|
|
35
|
-
{ 3, (const byte *)"for", c_for },
|
|
36
|
-
{ 3, (const byte *)"get", c_get },
|
|
37
|
-
{ 3, (const byte *)"hex", c_hex },
|
|
38
|
-
{ 3, (const byte *)"hop", c_hop },
|
|
39
|
-
{ 3, (const byte *)"len", c_len },
|
|
40
|
-
{ 3, (const byte *)"non", c_non },
|
|
41
|
-
{ 3, (const byte *)"not", c_not },
|
|
42
|
-
{ 3, (const byte *)"set", c_set },
|
|
43
|
-
{ 3, (const byte *)"try", c_try },
|
|
44
|
-
{ 4, (const byte *)"fail", c_fail },
|
|
45
|
-
{ 4, (const byte *)"goto", c_goto },
|
|
46
|
-
{ 4, (const byte *)"loop", c_loop },
|
|
47
|
-
{ 4, (const byte *)"next", c_next },
|
|
48
|
-
{ 4, (const byte *)"size", c_size },
|
|
49
|
-
{ 4, (const byte *)"test", c_test },
|
|
50
|
-
{ 4, (const byte *)"true", c_true },
|
|
51
|
-
{ 5, (const byte *)"among", c_among },
|
|
52
|
-
{ 5, (const byte *)"false", c_false },
|
|
53
|
-
{ 5, (const byte *)"lenof", c_lenof },
|
|
54
|
-
{ 5, (const byte *)"limit", c_limit },
|
|
55
|
-
{ 5, (const byte *)"unset", c_unset },
|
|
56
|
-
{ 6, (const byte *)"atmark", c_atmark },
|
|
57
|
-
{ 6, (const byte *)"attach", c_attach },
|
|
58
|
-
{ 6, (const byte *)"cursor", c_cursor },
|
|
59
|
-
{ 6, (const byte *)"define", c_define },
|
|
60
|
-
{ 6, (const byte *)"delete", c_delete },
|
|
61
|
-
{ 6, (const byte *)"gopast", c_gopast },
|
|
62
|
-
{ 6, (const byte *)"insert", c_insert },
|
|
63
|
-
{ 6, (const byte *)"maxint", c_maxint },
|
|
64
|
-
{ 6, (const byte *)"minint", c_minint },
|
|
65
|
-
{ 6, (const byte *)"repeat", c_repeat },
|
|
66
|
-
{ 6, (const byte *)"sizeof", c_sizeof },
|
|
67
|
-
{ 6, (const byte *)"tomark", c_tomark },
|
|
68
|
-
{ 7, (const byte *)"atleast", c_atleast },
|
|
69
|
-
{ 7, (const byte *)"atlimit", c_atlimit },
|
|
70
|
-
{ 7, (const byte *)"decimal", c_decimal },
|
|
71
|
-
{ 7, (const byte *)"reverse", c_reverse },
|
|
72
|
-
{ 7, (const byte *)"setmark", c_setmark },
|
|
73
|
-
{ 7, (const byte *)"strings", c_strings },
|
|
74
|
-
{ 7, (const byte *)"tolimit", c_tolimit },
|
|
75
|
-
{ 8, (const byte *)"booleans", c_booleans },
|
|
76
|
-
{ 8, (const byte *)"integers", c_integers },
|
|
77
|
-
{ 8, (const byte *)"routines", c_routines },
|
|
78
|
-
{ 8, (const byte *)"setlimit", c_setlimit },
|
|
79
|
-
{ 9, (const byte *)"backwards", c_backwards },
|
|
80
|
-
{ 9, (const byte *)"externals", c_externals },
|
|
81
|
-
{ 9, (const byte *)"groupings", c_groupings },
|
|
82
|
-
{ 9, (const byte *)"stringdef", c_stringdef },
|
|
83
|
-
{ 9, (const byte *)"substring", c_substring },
|
|
84
|
-
{ 12, (const byte *)"backwardmode", c_backwardmode },
|
|
85
|
-
{ 13, (const byte *)"stringescapes", c_stringescapes }
|
|
86
|
-
};
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
#include "api.h"
|
|
3
|
-
|
|
4
|
-
#define HEAD 2*sizeof(int)
|
|
5
|
-
|
|
6
|
-
#define SIZE(p) ((int *)(p))[-1]
|
|
7
|
-
#define SET_SIZE(p, n) ((int *)(p))[-1] = n
|
|
8
|
-
#define CAPACITY(p) ((int *)(p))[-2]
|
|
9
|
-
|
|
10
|
-
struct among
|
|
11
|
-
{
|
|
12
|
-
/* Number of symbols in s. */
|
|
13
|
-
int s_size;
|
|
14
|
-
/* Search string. */
|
|
15
|
-
const symbol * s;
|
|
16
|
-
/* Delta of index to longest matching substring, or 0 if none. */
|
|
17
|
-
int substring_i;
|
|
18
|
-
/* Result of the lookup. */
|
|
19
|
-
int result;
|
|
20
|
-
/* Optional condition routine, or NULL if none. */
|
|
21
|
-
int (* function)(struct SN_env *);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
extern symbol * create_s(void);
|
|
25
|
-
extern void lose_s(symbol * p);
|
|
26
|
-
|
|
27
|
-
extern int skip_utf8(const symbol * p, int c, int limit, int n);
|
|
28
|
-
|
|
29
|
-
extern int skip_b_utf8(const symbol * p, int c, int limit, int n);
|
|
30
|
-
|
|
31
|
-
extern int in_grouping_U(struct SN_env * z, const unsigned char * s, int min, int max, int repeat);
|
|
32
|
-
extern int in_grouping_b_U(struct SN_env * z, const unsigned char * s, int min, int max, int repeat);
|
|
33
|
-
extern int out_grouping_U(struct SN_env * z, const unsigned char * s, int min, int max, int repeat);
|
|
34
|
-
extern int out_grouping_b_U(struct SN_env * z, const unsigned char * s, int min, int max, int repeat);
|
|
35
|
-
|
|
36
|
-
extern int in_grouping(struct SN_env * z, const unsigned char * s, int min, int max, int repeat);
|
|
37
|
-
extern int in_grouping_b(struct SN_env * z, const unsigned char * s, int min, int max, int repeat);
|
|
38
|
-
extern int out_grouping(struct SN_env * z, const unsigned char * s, int min, int max, int repeat);
|
|
39
|
-
extern int out_grouping_b(struct SN_env * z, const unsigned char * s, int min, int max, int repeat);
|
|
40
|
-
|
|
41
|
-
extern int eq_s(struct SN_env * z, int s_size, const symbol * s);
|
|
42
|
-
extern int eq_s_b(struct SN_env * z, int s_size, const symbol * s);
|
|
43
|
-
extern int eq_v(struct SN_env * z, const symbol * p);
|
|
44
|
-
extern int eq_v_b(struct SN_env * z, const symbol * p);
|
|
45
|
-
|
|
46
|
-
extern int find_among(struct SN_env * z, const struct among * v, int v_size);
|
|
47
|
-
extern int find_among_b(struct SN_env * z, const struct among * v, int v_size);
|
|
48
|
-
|
|
49
|
-
extern int replace_s(struct SN_env * z, int c_bra, int c_ket, int s_size, const symbol * s, int * adjustment);
|
|
50
|
-
extern int slice_from_s(struct SN_env * z, int s_size, const symbol * s);
|
|
51
|
-
extern int slice_from_v(struct SN_env * z, const symbol * p);
|
|
52
|
-
extern int slice_del(struct SN_env * z);
|
|
53
|
-
|
|
54
|
-
extern int insert_s(struct SN_env * z, int bra, int ket, int s_size, const symbol * s);
|
|
55
|
-
extern int insert_v(struct SN_env * z, int bra, int ket, const symbol * p);
|
|
56
|
-
|
|
57
|
-
extern symbol * slice_to(struct SN_env * z, symbol * p);
|
|
58
|
-
extern symbol * assign_to(struct SN_env * z, symbol * p);
|
|
59
|
-
|
|
60
|
-
extern int len_utf8(const symbol * p);
|
|
61
|
-
|
|
62
|
-
extern void debug(struct SN_env * z, int number, int line_count);
|