24 lines
770 B
Ruby
24 lines
770 B
Ruby
class StanfordCorenlp < Formula
|
|
desc "Java suite of core NLP tools"
|
|
homepage "https://stanfordnlp.github.io/CoreNLP/"
|
|
url "https://nlp.stanford.edu/software/stanford-corenlp-4.2.0.zip"
|
|
sha256 "984aff1c431311a7dd5b4f0cb3bec4f5ba81da37aecc0d020b270571aafc5385"
|
|
license "GPL-2.0-or-later"
|
|
|
|
bottle :unneeded
|
|
|
|
depends_on "openjdk"
|
|
|
|
def install
|
|
libexec.install Dir["*"]
|
|
bin.install Dir["#{libexec}/*.sh"]
|
|
bin.env_script_all_files libexec, JAVA_HOME: Formula["openjdk"].opt_prefix
|
|
end
|
|
|
|
test do
|
|
(testpath/"test.txt").write("Stanford is a university, founded in 1891.")
|
|
system "#{bin}/corenlp.sh", "-annotators tokenize,ssplit,pos", "-file test.txt", "-outputFormat json"
|
|
assert_predicate (testpath/"test.txt.json"), :exist?
|
|
end
|
|
end
|