Added unicode support

Replaced strings with rune-slices, which capture unicode codepoints more
accurately.
This commit is contained in:
2024-11-18 10:41:50 -05:00
parent 805766a5ba
commit 8a1f1dc621
5 changed files with 8 additions and 8 deletions

View File

@@ -22,7 +22,7 @@ func dotChars() []rune { // Returns all possible characters represented by the d
}
// Returns true if str[idx] and str[idx-1] are separated by a word boundary.
func isWordBoundary(str string, idx int) bool {
func isWordBoundary(str []rune, idx int) bool {
str_runes := []rune(str)
wbounded := idx == 0 ||
idx >= len(str) ||