Project

jisho_sort

0.0
The project is in a healthy, maintained state
Sort Japanese letters, including Chinese letters, in dictionary order.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

>= 1.9.0
>= 0
 Project Readme

jisho_sort

jisho_sort is a Ruby sorting library based on MeCab. It provides functionality to sort Japanese strings containing a mix of Chinese and Japanese Letters 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 JishoSort:

require 'jisho_sort'

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

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.