fixed wrong description of replace step

This commit is contained in:
2023-12-01 22:04:28 +01:00
parent 7cc17ecb6d
commit b5e8c4d52b

View File

@@ -43,7 +43,7 @@ func main() {
for i := 0; i < len(line); i++ { for i := 0; i < len(line); i++ {
forwardReplacedLine += string(line[i]) forwardReplacedLine += string(line[i])
// replace found digit by its non-word counterpart (e.g. "one" -> "1") // replace all potential spelled out digits by their non-word counterpart (e.g. "one" -> "1")
for key, val := range reMap { for key, val := range reMap {
forwardReplacedLine = strings.ReplaceAll(forwardReplacedLine, key, val) forwardReplacedLine = strings.ReplaceAll(forwardReplacedLine, key, val)
} }
@@ -58,7 +58,7 @@ func main() {
backwardReplacedLine = string(line[i]) + backwardReplacedLine backwardReplacedLine = string(line[i]) + backwardReplacedLine
} }
// replace found digit by its non-word counterpart (e.g. "one" -> "1") // replace all potential spelled out digits by their non-word counterpart (e.g. "one" -> "1")
for key, val := range reMap { for key, val := range reMap {
backwardReplacedLine = strings.ReplaceAll(backwardReplacedLine, key, val) backwardReplacedLine = strings.ReplaceAll(backwardReplacedLine, key, val)
} }