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ㅙ':'ㆍ'+'ㅡ'+'ㅣ'+'ㆍ'+'ㅣ',
'ㅚ':'ㆍ'+'ㅡ'+'ㅣ',
'ㅛ':'ㆍ'+'ㆍ'+'ㅡ',
'ㅜ':'ㅡ'+'ㆍ',
'ㅝ':'ㅡ'+'ㆍ'+'ㆍ'+'ㅣ',
'ㅞ':'ㅡ'+'ㆍ'+'ㆍ'+'ㅣ'+'ㅣ',
'ㅟ':'ㅡ'+'ㆍ'+'ㅣ',
'ㅠ':'ㅡ'+'ㆍ'+'ㆍ',
'ㅡ':'ㅡ',
'ㅢ':'ㅡ'+'ㅣ',
'ㅣ':'ㅣ',
# 종성 단독
'':'',
'ㄳ':'ㄱㅅ',
'ㄵ':'ㄴㅅ'+ADD_LINE,
'ㄶ':'ㄴㅇ'+ADD_LINE,
'ㄺ':'ㄹㄱ',
'ㄻ':'ㄹㅁ',
'ㄼ':'ㄹㅁ'+ADD_LINE,
'ㄽ':'ㄹㅅ',
'ㄾ':'ㄹㄴ'+ADD_LINE+ADD_LINE,
'ㄿ':'ㄹㅁ'+ADD_LINE+ADD_LINE,
'ㅀ':'ㄹㅇ'+ADD_LINE,
'ㅄ':'ㅁ'+ADD_LINE+'ㅅ',
}
subchar_reverse_dict = {val:key for key, val in subchar_dict.items()}