Skip to content

Commit

Permalink
운운 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
uujinn committed Feb 6, 2022
1 parent 0300d1e commit f2d223c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
29 changes: 21 additions & 8 deletions Sources/BrailleToKor/BrailleToKor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,30 @@ public class BrailleToKor{
for word in punctuationTranslatedWords{
// let numberTranslateWords = translateNumber(text: word)
// print(word)
var replacedWord = word // 옹옹 처리 !!!
var replaceFlag = false
if word.contains("⠿⠿"){
replacedWord = word.replacingOccurrences(of: "⠿⠿", with: "")
replaceFlag = true
var replacedWord = word
var replace123456Flag = false // 옹옹 처리!
var replace1245Flag = false // 운운 처리!

if word.contains("⠛⠛"){
replacedWord = word.replacingOccurrences(of: "⠛⠛", with: "")
replace1245Flag = true
}
if replace1245Flag{
replacedWord = replacedWord.replacingOccurrences(of: "", with: "")
replace1245Flag = false
}


if replacedWord.contains("⠿⠿"){
replacedWord = replacedWord.replacingOccurrences(of: "⠿⠿", with: "")
replace123456Flag = true
}
if replaceFlag{
replacedWord = word.replacingOccurrences(of: "", with: "")
replaceFlag = false
if replace123456Flag{
replacedWord = replacedWord.replacingOccurrences(of: "", with: "")
replace123456Flag = false
}


result += brailleTosyllable(replacedWord)
result += " "
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/BrailleToKorTests/BrailleToKorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ final class BrailleToKorTests: XCTestCase {
// Use XCTAssert and related functions to verify your tests produce the correct
// results.
// XCTAssertEqual(BrailleToKor.translation("abc"), "Hello, World!")
print(BrailleToKor.translation("⠉⠝⠄⠠⠨⠗ ⠚⠧⠠⠻⠕⠤⠌⠬ ⠚⠧⠠⠻⠿⠿⠿⠵ ⠿"))
print(BrailleToKor.translation("⠉⠝⠄⠠⠨⠗ ⠚⠧⠠⠻⠕⠤⠌⠬ ⠚⠧⠠⠻⠿⠿⠿⠵ ⠿⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛"))

}
}

0 comments on commit f2d223c

Please sign in to comment.