All Projects → keepcosmos → Ununiga

keepcosmos / Ununiga

Licence: mit
[은는이가] 한글 조사(助詞) 대응 I18n engine extension

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Ununiga

Ifme
Free, open source mental health communication web app to share experiences with loved ones
Stars: ✭ 1,147 (+3273.53%)
Mutual labels:  i18n, rails
Vue Cli Plugin I18n
🌐 Vue CLI plugin to add vue-i18n to your Vue Project
Stars: ✭ 172 (+405.88%)
Mutual labels:  i18n, plugin
Translate enum
Easily Translate Enums in Rails
Stars: ✭ 90 (+164.71%)
Mutual labels:  i18n, rails
Vite ruby
⚡️ Vite.js in Ruby, bringing joy to your JavaScript experience
Stars: ✭ 112 (+229.41%)
Mutual labels:  rails, plugin
Mobility
Pluggable Ruby translation framework
Stars: ✭ 644 (+1794.12%)
Mutual labels:  i18n, rails
Vite Plugin Vue I18n
🌐 Vite plugin for Vue I18n
Stars: ✭ 48 (+41.18%)
Mutual labels:  i18n, plugin
I18n Debug
Ever wondered which translations are being looked up by Rails, a gem, or simply your app? Wonder no more!
Stars: ✭ 143 (+320.59%)
Mutual labels:  i18n, rails
Texterify
The localization management system.
Stars: ✭ 37 (+8.82%)
Mutual labels:  i18n, rails
Androidlocalizeplugin
🌏 Android localization plugin. support multiple languages, no need to apply for key.
Stars: ✭ 352 (+935.29%)
Mutual labels:  i18n, plugin
Spree i18n
I18n translation files for Spree Commerce.
Stars: ✭ 338 (+894.12%)
Mutual labels:  i18n, rails
Android Gradle Localization Plugin
Gradle plugin for generating localized string resources
Stars: ✭ 100 (+194.12%)
Mutual labels:  i18n, plugin
Vue I18n
🌐 Internationalization plugin for Vue.js
Stars: ✭ 6,502 (+19023.53%)
Mutual labels:  i18n, plugin
Vue I18next
Internationalization for vue using the i18next i18n ecosystem.
Stars: ✭ 172 (+405.88%)
Mutual labels:  i18n, plugin
Will paginate
Pagination library for Rails, Sinatra, Merb, DataMapper, and more
Stars: ✭ 5,621 (+16432.35%)
Mutual labels:  rails, plugin
Ordinalize full
Turns a number into an ordinal string such as first, second, third or 1st, 2nd, 3rd.
Stars: ✭ 6 (-82.35%)
Mutual labels:  i18n, rails
Zsh Lazyload
zsh plugin for lazy load commands and speed up start up time of zsh
Stars: ✭ 33 (-2.94%)
Mutual labels:  plugin
Samp Plugin Profiler
Performance profiler plugin for SA-MP server
Stars: ✭ 33 (-2.94%)
Mutual labels:  plugin
Condition Circle
Checks CircleCI environment before publishing successful build using semantic-release
Stars: ✭ 32 (-5.88%)
Mutual labels:  plugin
Formality
Forms made simple (and cute). Designless, multistep, conversational, secure, all-in-one WordPress forms plugin.
Stars: ✭ 30 (-11.76%)
Mutual labels:  plugin
Segment Open
Segment Source Distribution
Stars: ✭ 34 (+0%)
Mutual labels:  plugin

Build Status Gem Version

ununiga[은는이가]

은는이가는 한글의 자소를 분리하고 적절한 조사를 찾아주는 역할을 합니다.
I18n의 Backend 모듈도 제공합니다.

Installation

gem install ununiga

조사 찾기

require 'ununiga'

Ununiga::JosaPicker.takewell("레일즈와(과) 쟝고은(는) 싸우지 않습니다.")
# => "레일즈와 쟝고는 싸우지 않습니다."
Ununiga::JosaPicker.takewell("페이스북(으)로 로그인합니다.")
# => "페이스북으로 로그인합니다."

picker = Ununiga::JosaPicker.new("레일즈은(는) 루비을(를) 사용합니다.")
picker.takewell
# => "레일즈는 루비를 사용합니다.

picker.josas
# => [[3, ["은", "는"]], [10, ["을", "를"]]]

I18n에 적용하기

  1. Gemfile에 ununiga를 추가합니다.
gem 'ununiga'
  1. Initializer나 environment config파일에 아래 코드를 추가합니다.
I18n::Backend::Simple.send(:include, Ununiga::I18n::JosaTransformer)
  1. 한글 locale yml 파일에 조사를 사용하는 부분을 찾아 '은(는)|(는)은|을(를)...'등으로 조사를 변경합니다.
links:
  sign_in_with_provider: "%{provider}(으)로 로그인"

# Rails의 ActiveModel/ActiveRecord의 Validation을 사용할 경우
errors:
  # 디폴트는 `%{attribute} %{message}`형식으로 띄워쓰기가 되어 있으므로 format을 붙여쓰기로 변경해줍니다.
  foramt: "%{attribute}%{message}"
  messages:
    accepted: 을(를) 반드시 확인해야 합니다.
    equal_to: 은(는) %{count}와(과) 같아야 합니다

자소 분리하기

splitter = Ununiga::JasoSplitter.new('흯')
splitter.chosung       # => 'ㅎ'
splitter.jungsung      # => 'ㅢ'
splitter.jongsung      # => 'ㄳ'
splitter.split         # => ['ㅎ', 'ㅢ', 'ㄳ']

Test

두가지 방식으로 테스트 할 수 있습니다.

  • rake test 혹은 그냥 rake 커맨드를 사용합니다.
  • 특정 파일을 테스트할 경우 ruby -Ilib:test /test/{file_name} 을 사용합니다.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].