Last active
February 16, 2019 11:41
-
-
Save elegantcoder/aad386a8155755312ebeee01acea6661 to your computer and use it in GitHub Desktop.
한글 은/는, 이/가 (Powered by ActiveSupport::Multibyte::Chars)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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