Korean Sentence Analyser v0.2.3 KoreanUnicode View Source
Contains functions helpful in dealing with Hangul
Explanations can be found at:
https://en.wikipedia.org/wiki/Korean_language_and_computers#Hangul_in_Unicode
https://en.wikipedia.org/wiki/HangulJamo(Unicode_block)
Link to this section Summary
Functions
Change the final consonant of a character If you pass in a word, it will change the final consonant of the last character
Create a unicode character from code points
Create a unicode character from a decimal value
Create a unicode hangul character from a decimal value
Deduct the start location in unicode from the decimal value
Does it end with a certain Jamo?
Get the final consonant code point
Get the final consonant
Get the initial consonant code point
Get the initial consonant decimal value
Get the medial vowel code point
Get the medial vowel
Get the decimal value of a character
Remove a final consonant and return the string without it
Split a sentence into only Korean words
Does it start with a certain Jamo?
Link to this section Functions
change_final_consonant(word, new_final_consonant) View Source
Change the final consonant of a character If you pass in a word, it will change the final consonant of the last character
iex> KoreanUnicode.change_final_consonant("노랗", "ᆫ")
"노란"
create_from_code_points(initial_consonant_code_point, medial_vowel_code_point, final_consonant_code_point) View Source
Create a unicode character from code points
iex> KoreanUnicode.create_from_code_points(0,0,0)
"가"
iex> KoreanUnicode.create_from_code_points(1,0,3)
"깏"
create_from_decimal_value(decimal_value) View Source
Create a unicode character from a decimal value
iex> KoreanUnicode.create_from_decimal_value(55200)
"힠"
create_hangul_from_decimal_value(decimal_value) View Source
Create a unicode hangul character from a decimal value
Note: Does not create Jamo, only Hangul
iex> KoreanUnicode.create_hangul_from_decimal_value(44032)
"가"
deduct_unicode_start_location(decimal_value) View Source
Deduct the start location in unicode from the decimal value
ends_with_final?(character, jamo) View Source
Does it end with a certain Jamo?
iex> KoreanUnicode.ends_with_final?("씻", "ᆺ")
true
get_final_code_point(character) View Source
Get the final consonant code point
iex> KoreanUnicode.get_final_code_point("한")
4
iex> KoreanUnicode.get_final_code_point("해")
0
get_final_consonant(character) View Source
Get the final consonant
iex> KoreanUnicode.get_final_consonant("한")
"ᆫ"
iex> KoreanUnicode.get_final_consonant("해")
nil
get_initial_code_point(character) View Source
Get the initial consonant code point
iex> KoreanUnicode.get_initial_code_point("한")
18
get_initial_consonant(character) View Source
Get the initial consonant decimal value
iex> KoreanUnicode.get_initial_consonant("한")
"ᄒ"
get_medial_code_point(character) View Source
Get the medial vowel code point
iex> KoreanUnicode.get_medial_code_point("한")
0
get_medial_vowel(character) View Source
Get the medial vowel
iex> KoreanUnicode.get_medial_vowel("해")
"ᅢ"
get_unicode_decimal_value(arg) View Source
Get the decimal value of a character
iex> KoreanUnicode.get_unicode_decimal_value("는")
45716
remove_final_consonant(word) View Source
Remove a final consonant and return the string without it
iex> KoreanUnicode.remove_final_consonant("마실")
"마시"
split(arg1) View Source
Split a sentence into only Korean words
iex> KoreanUnicode.split("투표......당신의 소중한 한표....ㅋㅋ")
["투표", "당신의", "소중한", "한표"]
starts_with?(character, jamo) View Source
Does it start with a certain Jamo?
iex> KoreanUnicode.starts_with?("가", "ᄀ")
true