Coder Social home page Coder Social logo

yoshoku / suika Goto Github PK

View Code? Open in Web Editor NEW
39.0 5.0 1.0 37.11 MB

Suika ๐Ÿ‰ is a Japanese morphological analyzer written in pure Ruby

License: BSD 3-Clause "New" or "Revised" License

Ruby 98.63% Shell 1.03% JavaScript 0.34%
nlp postagger tokenizer morphological-analysis ruby

suika's Introduction

Suika

Build Status Gem Version BSD 3-Clause License Documentation

Suika ๐Ÿ‰ is a Japanese morphological analyzer written in pure Ruby.

Installation

Add this line to your application's Gemfile:

gem 'suika'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install suika

Usage

require 'suika'

tagger = Suika::Tagger.new
tagger.parse('ใ™ใ‚‚ใ‚‚ใ‚‚ใ‚‚ใ‚‚ใ‚‚ใ‚‚ใ‚‚ใฎใ†ใก').each { |token| puts token }

# ใ™ใ‚‚ใ‚‚  ๅ่ฉž,ไธ€่ˆฌ,*,*,*,*,ใ™ใ‚‚ใ‚‚,ใ‚นใƒขใƒข,ใ‚นใƒขใƒข
# ใ‚‚      ๅŠฉ่ฉž,ไฟ‚ๅŠฉ่ฉž,*,*,*,*,ใ‚‚,ใƒข,ใƒข
# ใ‚‚ใ‚‚    ๅ่ฉž,ไธ€่ˆฌ,*,*,*,*,ใ‚‚ใ‚‚,ใƒขใƒข,ใƒขใƒข
# ใ‚‚      ๅŠฉ่ฉž,ไฟ‚ๅŠฉ่ฉž,*,*,*,*,ใ‚‚,ใƒข,ใƒข
# ใ‚‚ใ‚‚    ๅ่ฉž,ไธ€่ˆฌ,*,*,*,*,ใ‚‚ใ‚‚,ใƒขใƒข,ใƒขใƒข
# ใฎ      ๅŠฉ่ฉž,้€ฃไฝ“ๅŒ–,*,*,*,*,ใฎ,ใƒŽ,ใƒŽ
# ใ†ใก    ๅ่ฉž,้ž่‡ช็ซ‹,ๅ‰ฏ่ฉžๅฏ่ƒฝ,*,*,*,ใ†ใก,ใ‚ฆใƒ,ใ‚ฆใƒ

Since the Tagger class loads the binary dictionary at initialization, it is recommended to reuse the instance.

tagger = Suika::Tagger.new

sentences.each do |sentence|
  result = tagger.parse(sentence)

  # ...
end

Test

Suika was able to parse all sentences in the Livedoor news corpus without any error.

require 'suika'

tagger = Suika::Tagger.new

Dir.glob('ldcc-20140209/text/*/*.txt').each do |filename|
  File.foreach(filename) do |sentence|
    sentence.strip!
    puts tagger.parse(sentence) unless sentence.empty?
  end
end

suika_test

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/yoshoku/suika. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the BSD-3-Clause License. In addition, the gem includes binary data generated from mecab-ipadic. The details of the license can be found in LICENSE.txt and NOTICE.txt.

Respect

  • Taku Kudo is the author of MeCab that is the most famous morphological analyzer in Japan. MeCab is one of the great software in natural language processing. Suika is created with reference to the book on morphological analysis written by Dr. Kudo.
  • Tomoko Uchida is the author of Janome that is a Japanese morphological analysis engine written in pure Python. Suika is heavily influenced by Janome's idea to include the built-in dictionary and language model. Janome, a morphological analyzer written in scripting language, gives me the courage to develop Suika.

suika's People

Contributors

dependabot[bot] avatar yoshoku avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

kojix2

suika's Issues

GUI

Glimmer-DSL-LibUI ใ‚’ใคใ‹ใฃใฆGUIใ‚’ใคใ‘ใฆใฟใพใ—ใŸใ€‚50่กŒใฎใ‚นใ‚ฏใƒชใƒ—ใƒˆใงใ™ใ€‚

https://github.com/kojix2/suikabox

ใ‚ใพใ‚Šๆคœ่จผใ—ใฆใ„ใชใ„ใฎใงใฉใ“ใ‹ใงใ‚ณใ‚ฑใ‚‹ใ‹ใ‚‚ใ€‚

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.