Skip to content

Instantly share code, notes, and snippets.

@elegantcoder
Last active February 16, 2019 11:41
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save elegantcoder/aad386a8155755312ebeee01acea6661 to your computer and use it in GitHub Desktop.
Save elegantcoder/aad386a8155755312ebeee01acea6661 to your computer and use it in GitHub Desktop.
한글 은/는, 이/가 (Powered by ActiveSupport::Multibyte::Chars)
# require 'active_support/all'
def korean_topic_marker(str)
k = str[-1] # last one char
return '는' if k.mb_chars.decompose.size < 3 # 종성이 없는 경우
return '은'
end
def korean_subject_marker(str)
k = str[-1] # last one char
return '가' if k.mb_chars.decompose.size < 3 # 종성이 없는 경우
return '이'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment