Project

jisx0208

0.0
The project is in a healthy, maintained state
Determines if a character is included in jisx0208 with JIS0208.TXT
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Jisx0208

JIS X 0208 is a collection of common characters used in Japanese writing, place names, and people's names. jisx0208 is a Ruby gem that provides a simple way to check if a string contains JIS X 0208 characters.

Installation

gem install jisx0208

Usage

require "jisx0208"

code = JISX0208::Code.new
code.contains_first_level_kanji?("亜") # => true
code.contains_first_level_kanji?("弌") # => false
code.contains_seconde_level_kanji?("弌") # => true
code.contains_seconde_level_kanji?("亜") # => false
# same as (contains_first_level_kanji || contains_seconde_level_kanji)
code.contains_jisx0208_kanji?("亜弌") # => true
code.only_first_level_kanji?("回転寿司") # => true
code.only_second_level_kanji?("偃龠偕") # => true
# only (first level kanji + second level kanji)
code.only_jisx0208_kanji?("回転寿司偃龠偕") # => true
# hiragana, katakana, multi byte symbols + first level kanji
code.only_common_japanese_characters?("呪術廻戦は最高!") # => true