homebrew-core/Formula/cabocha.rb

57 lines
1.9 KiB
Ruby
Raw Normal View History

class Cabocha < Formula
desc "Yet Another Japanese Dependency Structure Analyzer"
2015-04-24 13:34:59 +00:00
homepage "https://taku910.github.io/cabocha/"
url "https://googledrive.com/host/0B4y35FiV1wh7cGRCUUJHVTNJRnM/cabocha-0.69.tar.bz2"
sha256 "9db896d7f9d83fc3ae34908b788ae514ae19531eb89052e25f061232f6165992"
2015-01-27 14:46:21 +00:00
bottle do
2016-09-28 18:42:26 +00:00
sha256 "27bd41bab80ab64fb32e5bc8b568864b874f0dec16817d38c37abd3c7582c694" => :sierra
2015-09-24 13:56:14 +00:00
sha256 "bf3ed6bc9333b43919264913c40a86997a7601a83abf6dcfa1dfe14745b3fc7c" => :el_capitan
2015-11-19 15:45:31 +00:00
sha256 "fe97decdca655899faffd6356bb8ddbb52d4949222690835374c3aeb9a65cdb2" => :yosemite
sha256 "794df46e362f3146b2bab17ba132978609954b0ba0a51ffa4d6d4e8845548764" => :mavericks
sha256 "b1aaf6623ac7332459c795ebd992ed92224b0d0b9e20fb57dd0313fbeea7647c" => :mountain_lion
2015-01-27 14:46:21 +00:00
end
option "with-charset=", "choose default charset: EUC-JP, CP932, UTF8"
option "with-posset=", "choose default posset: IPA, JUMAN, UNIDIC"
deprecated_option "charset=" => "with-charset="
deprecated_option "posset=" => "with-posset="
2015-12-19 06:29:12 +00:00
depends_on "crf++"
depends_on "mecab"
# To see which dictionaries are available, run:
# ls `mecab-config --libs-only-L`/mecab/dic/
depends_on "mecab-ipadic" => :recommended
depends_on "mecab-jumandic" => :optional
depends_on "mecab-unidic" => :optional
def install
ENV["LIBS"] = "-liconv"
inreplace "Makefile.in" do |s|
s.change_make_var! "CFLAGS", ENV.cflags
s.change_make_var! "CXXFLAGS", ENV.cflags
end
charset = ARGV.value("with-charset") || "UTF8"
posset = ARGV.value("with-posset") || "IPA"
args = %W[
--disable-dependency-tracking
--prefix=#{prefix}
--with-charset=#{charset}
--with-posset=#{posset}
]
system "./configure", *args
system "make", "install"
end
test do
result = `echo "CaboCha はフリーソフトウェアです。" | cabocha | md5`.chomp
assert_equal "a5b8293e6ebcb3246c54ecd66d6e18ee", result
end
end