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