Giter Site home page Giter Site logo

groonga-tokenizer-yamecab's Introduction

Yet another MeCab tokenizer plugin for Groonga

Mecabを使ったトークナイザー。

名詞, 動詞, 形容詞, 連体詞, 未知語以外はスキップされます。

Install

Source install

Build this tokenizer.

% sh autogen.sh
% ./configure
% make
% sudo make install

Dependencies

  • Groonga >= 4.0.5

Install groonga-devel in CentOS/Fedora. Install libgroonga-dev in Debian/Ubutu.

See http://groonga.org/docs/install.html

Usage

Firstly, register tokenizers/yamecab

Groonga:

% groonga db
> register tokenizers/yamecab
> table_create Diaries TABLE_HASH_KEY INT32
> column_create Diaries body COLUMN_SCALAR TEXT
> table_create Terms TABLE_PAT_KEY ShortText \
>   --default_tokenizer TokenYaMecab
> column_create Terms diaries_body COLUMN_INDEX|WITH_POSITION Diaries body

Mroonga:

mysql> use db;
mysql> select mroonga_command("register tokenizers/yamecab");
mysql> CREATE TABLE `Diaries` (
    -> id INT NOT NULL,
    -> body TEXT NOT NULL,
    -> PRIMARY KEY (id) USING HASH,
    -> FULLTEXT INDEX (body) COMMENT 'parser "TokenYaMecab"'
    -> ) ENGINE=mroonga DEFAULT CHARSET=utf8;

Rroonga:

irb --simple-prompt -rubygems -rgroonga
>> Groonga::Context.default_options = {:encoding => :utf8}   
>> context = Groonga::Context.new
>> Groonga::Database.create(:path => "/tmp/db", :context => context)
>> context.register_plugin(:path => "tokenizers/yamecab.so")
>> Groonga::Schema.create_table("Diaries",
?>                              :type => :hash,
?>                              :key_type => :integer32,
?>                              :context => context) do |table|
?>   table.text("body")
>> end
>> Groonga::Schema.create_table("Terms",
?>                              :type => :patricia_trie,
?>                              :normalizer => :NormalizerAuto,
?>                              :default_tokenizer => "TokenYaMecab",
?>                              :context => context) do |table|
?>   table.index("Diaries.body")
>> end

Author

License

LGPL 2.1. See COPYING for details.

This is programmed based on the Groonga MeCab tokenizer.
https://github.com/groonga/groonga/blob/master/plugins/tokenizers/mecab.c

This program is the same license as Groonga.

The Groonga MeCab tokenizer is povided by Copyright(C) 2009-2012 Brazil

groonga-tokenizer-yamecab's People

Contributors

naoa avatar

Stargazers

meru avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.