Skip to content

Commit

Permalink
Fix #2726 (TTS & sentence splitter: chinese dot is not recognized)
Browse files Browse the repository at this point in the history
  • Loading branch information
tuomas2 committed Sep 14, 2023
1 parent 49e0e6d commit 53e92d6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ class SpeakCommandArray: ArrayList<SpeakCommand>() {
} else {
4000
}
private val endsWithSentenceBreak = Regex(""".*[.?!]+[\p{Pf}"']*\W*""", RegexOption.DOT_MATCHES_ALL)
private val splitIntoTwoSentences = Regex("""(.*)([.?!]+[\p{Pf}"']*)(\W*.+)""", RegexOption.DOT_MATCHES_ALL)
private val startsWithDelimiter = Regex("""([,.?!"':;()]+|'s)(\p{Zs}.*|)""", RegexOption.DOT_MATCHES_ALL)
private val endsWithSentenceBreak = Regex(""".*[.?!]+[\p{Pf}"']*\W*""", RegexOption.DOT_MATCHES_ALL)
private val splitIntoTwoSentences = Regex("""(.*)([.?!]+[\p{Pf}"']*)(\W*.+)""", RegexOption.DOT_MATCHES_ALL)
private val startsWithDelimiter = Regex("""([,.?!"':;(),;]+|'s)(\p{Zs}.*|)""", RegexOption.DOT_MATCHES_ALL)

fun copy(): SpeakCommandArray {
val cmds = SpeakCommandArray()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ object SwordContentFacade {
// group 1: before marker
"""((\d{2,}|\D)""" +
// marker itself
"""(([.,;:!?]["'\p{Pf}]?\p{Z}+)|(\p{Z}*\p{Pd}\p{Z}*)))"""+
"""(([.,;:!?。,;]["'\p{Pf}]?\p{Z}+)|(\p{Z}*\p{Pd}\p{Z}*)))"""+
// group 6: after marker
"""(["'¡¿\p{Pi}]?\p{L})"""
)
Expand Down

0 comments on commit 53e92d6

Please sign in to comment.