aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorKim Ahlström2010-04-24 20:01:49 +0900
committerAdam Vandenberg2010-09-08 07:51:36 -0700
commit792d20f153994cbe9e03dedae9af5e87b72044e1 (patch)
tree6b92444e69fd610c2dc2b6c3219a1f22b51e2109 /Library/Formula
parent412e829e42908486ca1e79d43335bc91aca9b891 (diff)
downloadhomebrew-792d20f153994cbe9e03dedae9af5e87b72044e1.tar.bz2
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>
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/mecab-ipadic.rb17
-rw-r--r--Library/Formula/mecab.rb12
2 files changed, 29 insertions, 0 deletions
diff --git a/Library/Formula/mecab-ipadic.rb b/Library/Formula/mecab-ipadic.rb
new file mode 100644
index 000000000..9d4433260
--- /dev/null
+++ b/Library/Formula/mecab-ipadic.rb
@@ -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
diff --git a/Library/Formula/mecab.rb b/Library/Formula/mecab.rb
new file mode 100644
index 000000000..6303ce427
--- /dev/null
+++ b/Library/Formula/mecab.rb
@@ -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