Skip to content

Commit

Permalink
빈 칸 대신 대체 문자 리턴
Browse files Browse the repository at this point in the history
  • Loading branch information
kimcore committed Jul 21, 2020
1 parent 62f6e63 commit e44d638
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/main/kotlin/com/github/kimcore/josa/Josa.kt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,17 @@ object Josa {
fun get(s: String, format: String): String {
if (!formats.containsKey(format)) throw UnknownFormatException()
val value = replace(s)
if (value.isBlank()) return "을(를)"
if (value.isBlank()) return when (formats.getValue(format)) {
handlers[0] -> "을(를)"
handlers[1] -> "은(는)"
handlers[2] -> "이(가)"
handlers[3] -> "와(과)"
handlers[4] -> "(으)로"
handlers[5] -> "(이)나"
handlers[6] -> "아(야)"
handlers[7] -> "(이)라"
else -> "(이)야"
}
return formats.getValue(format)(value)
}

Expand Down

0 comments on commit e44d638

Please sign in to comment.