wget "https://drive.google.com/uc?export=download&id=0B4y35FiV1wh7cENtOXlicTFaRUE" -O mecab-0.996.tar.gz
Last active
August 5, 2020 01:43
-
-
Save okanon/a69cdb13f4fdceeea8d3eb4d06d49de2 to your computer and use it in GitHub Desktop.
Eat MeCab-Java built on Ubuntu and macOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- Makefile 2020-08-05 07:57:26.703600861 +0900 | |
+++ Makefile_macOS 2020-08-05 07:58:51.705329200 +0900 | |
@@ -12,7 +12,7 @@ INC=`mecab-config --cflags` -I$(INCLUDE) | |
all: | |
$(CXX) -O3 -c -fpic $(TARGET)_wrap.cxx $(INC) | |
- $(CXX) -shared $(TARGET)_wrap.o -o lib$(TARGET).so $(LIBS) | |
+ $(CXX) -dynamiclib $(TARGET)_wrap.o -o lib$(TARGET).dylib $(LIBS) | |
$(JAVAC) $(PACKAGE)/*.java | |
$(JAVAC) test.java | |
$(JAR) cfv $(TARGET).jar $(PACKAGE)/*.class | |
@@ -21,7 +21,7 @@ test: | |
env LD_LIBRARY_PATH=. $(JAVA) test | |
clean: | |
- rm -fr *.jar *.o *.so *.class $(PACKAGE)/*.class | |
+ rm -fr *.jar *.o *.dylib *.so *.class $(PACKAGE)/*.class | |
cleanall: | |
- rm -fr $(TARGET).java *.cxx | |
+ rm -fr $(TARGET).java *.cxxmecab-java |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File | |
import org.chasen.mecab.Tagger | |
object MeCabMain extends App { | |
val lib: File = new File("lib/" + System.mapLibraryName("MeCab")); | |
System.load(lib.getAbsolutePath()); | |
val t = new Tagger | |
println(t.parse("パンケーキ食べたい")) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment