fixed wrong description of replace step
This commit is contained in:
4
main.go
4
main.go
@@ -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)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user