diff --git a/Formula/snowball.rb b/Formula/snowball.rb new file mode 100644 index 000000000000..ff0644da5aa0 --- /dev/null +++ b/Formula/snowball.rb @@ -0,0 +1,22 @@ +class Snowball < Formula + desc "Stemming algorithms" + homepage "https://snowballstem.org" + url "https://github.com/snowballstem/snowball/archive/refs/tags/v2.2.0.tar.gz" + sha256 "425cdb5fba13a01db59a1713780f0662e984204f402d3dae1525bda9e6d30f1a" + license "BSD-3-Clause" + + def install + system "make" + + lib.install "libstemmer.a" + include.install Dir["include/*"] + pkgshare.install "examples" + end + + test do + (testpath/"test.txt").write("connection") + cp pkgshare/"examples/stemwords.c", testpath + system ENV.cc, "stemwords.c", "-L#{lib}", "-lstemmer", "-o", "test" + assert_equal "connect\n", shell_output("./test -i test.txt") + end +end