Added formula for mecab, a Japanese morphological analyser

mecab is the main application that does morphological analysis on Japanese text.
mecab-ipadic is data that is required by mecab to work. This is the recommended data file by the author, but other data files are available on the mecab homepage.

This formula sets utf-8 as the default charset for mecab-ipadic, but this can be changed with the --with-charset=[sjis|euc-jp] flag.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
This commit is contained in:
Kim Ahlström 2010-04-24 20:01:49 +09:00 committed by Adam Vandenberg
parent 1040b286e2
commit f3e343826d
2 changed files with 29 additions and 0 deletions

17
Formula/mecab-ipadic.rb Normal file
View file

@ -0,0 +1,17 @@
require 'formula'
class MecabIpadic <Formula
url 'http://downloads.sourceforge.net/project/mecab/mecab-ipadic/2.7.0-20070801/mecab-ipadic-2.7.0-20070801.tar.gz'
homepage 'http://mecab.sourceforge.net/'
md5 'e09556657cc70e45564c6514a6b08495'
depends_on "mecab"
def install
args = ["--disable-debug", "--disable-dependency-tracking", "--prefix=#{prefix}"]
args << ARGV.find(Proc.new {"--with-charset=utf8"}) { |arg| /^--with-charset/.match(arg) }
system "./configure", *args
system "make install"
end
end

12
Formula/mecab.rb Normal file
View file

@ -0,0 +1,12 @@
require 'formula'
class Mecab <Formula
url 'http://downloads.sourceforge.net/project/mecab/mecab/0.98/mecab-0.98.tar.gz'
homepage 'http://mecab.sourceforge.net/'
md5 'b3d8d79e35acf0ca178e8d885309f5fd'
def install
system "./configure", "--disable-debug", "--disable-dependency-tracking", "--prefix=#{prefix}"
system "make install"
end
end