Skip to content
Lua wrapper for Mecab Japanese morphological analyzer.
C++ Makefile Lua
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Makefile
README.md
lua-mecab.cpp
mecab-dev-1.rockspec
test.lua
waga.utf8

README.md

lua-mecab

This is a lua wrapper for Mecab. It only supports the Tagger class's parse method, but generally that's all you need.

Install

You can install it with LuaRocks like so:

luarocks install mecab

Alternately build it using the instructions below.

Building

Build with make.

The Makefile assumes libmecab.so can be found in /usr/lib; if it's somewhere else call make like so:

make MECAB_SO=/path/to/libmecab.so

and you should be fine.

Usage

Copy the lua-mecab.so file to your lua project and then use it like this:

mecab = require "mecab" -- if you build it yourself, use the .so name (lua-mecab) here
parser = mecab:new("") -- you can pass mecab config options here, like "-Owakati"

print(parser:parse("吾輩は猫である"))

License

WTFPL, do as you please.

You can’t perform that action at this time.