Skip to content

fvknk97034/jisho_sort

Repository files navigation

jisho_sort

jisho_sort is a Ruby sorting library based on MeCab. It provides functionality to sort Japanese strings. These strings may contain a mix of Chinese and Japanese letters, sorted in dictionary order.

Installation

This code depends on MeCab, so you need to install MeCab. For more MeCab Install instructions, please refer to the MeCab installation guide.

After installing MeCab, Add this line to Gemfile:

gem 'jisho_sort'

And then execute:

bundle install

Or install it as:

gem install jisho_sort

Usage

Here's a basic example of how to use jisho_sort:

require 'jisho_sort'

array = [
  'ゆく川の流れは絶えずして、しかももとの水にあらず',
  'メロスは激怒した',
  '国境の長いトンネルを抜けると雪国であった'
]
p array.jisho_sort

When you run this code, you will get the following result:

$ ruby sample.rb
=> ["国境の長いトンネルを抜けると雪国であった", "メロスは激怒した", "ゆく川の流れは絶えずして、しかももとの水にあらず"]

License

The gem is available as open source under the terms of the MIT License.

This project uses the following products:

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors