Handle single-word newline variants
This commit is contained in:
parent
e275bddbf6
commit
a345f039d5
@ -20,6 +20,20 @@ struct WhisperTextFormatter {
|
||||
)
|
||||
}
|
||||
|
||||
// Handle single-word variants
|
||||
let singleWordPatterns = [
|
||||
(pattern: "\\b(newline)\\b", replacement: "new line"),
|
||||
(pattern: "\\b(newparagraph)\\b", replacement: "new paragraph")
|
||||
]
|
||||
|
||||
for (pattern, replacement) in singleWordPatterns {
|
||||
formattedText = formattedText.replacingOccurrences(
|
||||
of: pattern,
|
||||
with: replacement,
|
||||
options: [.regularExpression, .caseInsensitive]
|
||||
)
|
||||
}
|
||||
|
||||
// Then handle the new line/paragraph commands with any combination of spaces and punctuation
|
||||
let patterns = [
|
||||
// Handle "new paragraph" with any combination of spaces and punctuation
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user