52 lines
1.9 KiB
Ruby
52 lines
1.9 KiB
Ruby
class Freeling < Formula
|
|
desc "Suite of language analyzers"
|
|
homepage "http://nlp.lsi.upc.edu/freeling/"
|
|
url "https://github.com/TALP-UPC/FreeLing/releases/download/4.2/FreeLing-src-4.2.tar.gz"
|
|
sha256 "f96afbdb000d7375426644fb2f25baff9a63136dddce6551ea0fd20059bfce3b"
|
|
license "AGPL-3.0-only"
|
|
revision 2
|
|
|
|
bottle do
|
|
sha256 "18aeb17c8cf2d6b4700831087ce7782d149c588fa22488b9212eb76dbbe8bcfd" => :arm64_big_sur
|
|
sha256 "d24c427d939b86a94f54c2ebc4b36b87f52b5162b03aa22865b1401230e7af09" => :catalina
|
|
sha256 "62c7706b13a0513663d6e57ea45e4df8680e869b657e737cb2a688377e949f5a" => :mojave
|
|
end
|
|
|
|
depends_on "cmake" => :build
|
|
depends_on "boost"
|
|
depends_on "icu4c"
|
|
|
|
conflicts_with "dynet", because: "freeling ships its own copy of dynet"
|
|
conflicts_with "eigen", because: "freeling ships its own copy of eigen"
|
|
conflicts_with "foma", because: "freeling ships its own copy of foma"
|
|
conflicts_with "hunspell", because: "both install 'analyze' binary"
|
|
|
|
def install
|
|
# Allow compilation without extra data (more than 1 GB), should be fixed
|
|
# in next release
|
|
# https://github.com/TALP-UPC/FreeLing/issues/112
|
|
inreplace "CMakeLists.txt", "SET(languages \"as;ca;cs;cy;de;en;es;fr;gl;hr;it;nb;pt;ru;sl\")",
|
|
"SET(languages \"en;es;pt\")"
|
|
inreplace "CMakeLists.txt", "SET(variants \"es/es-old;es/es-ar;es/es-cl;ca/balear;ca/valencia\")",
|
|
"SET(variants \"es/es-old;es/es-ar;es/es-cl\")"
|
|
|
|
mkdir "build" do
|
|
system "cmake", "..", *std_cmake_args
|
|
system "make", "install"
|
|
end
|
|
|
|
libexec.install "#{bin}/fl_initialize"
|
|
inreplace "#{bin}/analyze",
|
|
". $(cd $(dirname $0) && echo $PWD)/fl_initialize",
|
|
". #{libexec}/fl_initialize"
|
|
end
|
|
|
|
test do
|
|
expected = <<~EOS
|
|
Hello hello NN 1
|
|
world world NN 1
|
|
EOS
|
|
assert_equal expected, pipe_output("#{bin}/analyze -f #{pkgshare}/config/en.cfg", "Hello world").chomp
|
|
end
|
|
end
|