Option Explicit
Dim blnChk As Boolean
Dim Str1st() As String
Dim Str2nd() As String
Dim Str3rd() As String
Private Sub strBase()
Dim strFirst As String, strMiddle As String, strFinal As String
strFirst = "ㄱ ㄲ ㄴ ㄷ ㄸ ㄹ ㅁ ㅂ ㅃ ㅅ ㅆ ㅇ ㅈ ㅉ ㅊ ㅋ ㅌ ㅍ ㅎ"
strMiddle = "ㅏ ㅐ ㅑ ㅒ ㅓ ㅔ ㅕ ㅖ ㅗ ㅘ ㅙ ㅚ ㅛ ㅜ ㅝ ㅞ ㅟ ㅠ ㅡ ㅢ ㅣ"
strFinal = " ㄱ ㄲ ㄳ ㄴ ㄵ ㄶ ㄷ ㄹ ㄺ ㄻ ㄼ ㄽ ㄾ ㄿ ㅀ ㅁ ㅂ ㅄ ㅅ" & _
" ㅆ ㅇ ㅈ ㅊ ㅋ ㅌ ㅍ ㅎ"
Str1st = Split(strFirst)
Str2nd = Split(strMiddle)
Str3rd = Split(strFinal)
End Sub
Private Function StrtoPhon(ByVal strKor As String) As String
Dim lngUnicode As Long, lngCode As Long, first As String
Dim middle As String, last As String
lngUnicode = AscW(strKor)
If lngUnicode < &HAC00 Or lngUnicode > &HD7A3 Then
StrtoPhon = strKor
Else
lngCode = lngUnicode - &HAC00
'초중종성을 분리하는 핵심구문이라고 하네요^^
first = Str1st(Int(lngCode / (21 * 28)))
lngCode = lngCode Mod (21 * 28)
middle = Str2nd(Int(lngCode / 28))
last = Str3rd(lngCode Mod 28)
StrtoPhon = first & middle & last
End If
End Function
Function STRTOSYLLABLE(ByVal strKorean As String) As String
Dim i As Long, j As Long, strTemp As String, strX() As String
If Not blnChk Then strBase
j = Len(strKorean)
ReDim strX(1 To j)
For i = 1 To j
strTemp = Mid$(strKorean, i, 1)
strTemp = StrtoPhon(strTemp)
strX(i) = strTemp
Next i
STRTOSYLLABLE = Join(strX, "")
End Function
내용은 이러한데... 뭐가 문제일까요? -_-;;;;
예를 들어... 가나다.. 하고 찿았더니.. 캬갸나.. 하는 식으로.. ㅡㅡ;;
일률적으로 같은 값이 나오는걸 보니.. 뭐가 엉킨? 모양인데..
도데체 이유를 모르겠슴다 ㅜ.ㅜ
p/s.. 참고로 위에 모듈은 초성 분리 모듈 이어유.. ㄷㄷㄷㄷㄷ
|