Skip to content

Commit d9267e9

Browse files
committed
Update ChatUtils.kt
1 parent 53061c2 commit d9267e9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main/kotlin/com/lambda/util/ChatUtils.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,7 @@ object ChatUtils {
2525
val addresses = sequenceOf("^(?:[0-9]{1,3}\\.){3}[0-9]{1,3}(:\\d{1,5}$)?", "^(\\[?)(\\:\\:)?[0-9a-fA-F]{1,4}(\\:\\:?[0-9a-fA-F]{1,4}){0,7}(\\:\\:)?(\\])?(:\\d{1,5}$)?$").map { Regex(it) }
2626
val colors = sequenceOf(">", "`").map { Regex(it) }
2727

28+
val fancyToAscii = mapOf('' to 'a', 'ʙ' to 'b', 'c' to 'c', '' to 'd', '' to 'e', '' to 'f', 'ɢ' to 'g', 'ʜ' to 'h', 'ɪ' to 'i', '' to 'j', '' to 'k', 'ʟ' to 'l', '' to 'm', 'ɴ' to 'n', '' to 'o', '' to 'p', 'q' to 'q', 'ʀ' to 'r', '' to 's', '' to 't', '' to 'u', '' to 'v', '' to 'w', 'x' to 'x', 'y' to 'y', '' to 'z',)
29+
30+
val String.toAscii get() = map { fancyToAscii.getOrDefault(it, it) }
2831
}

0 commit comments

Comments
 (0)