diff --git a/src/MiniDocs/String.extension.st b/src/MiniDocs/String.extension.st index 23de2db..87fe274 100644 --- a/src/MiniDocs/String.extension.st +++ b/src/MiniDocs/String.extension.st @@ -19,3 +19,16 @@ String >> asDashedLowercase [ ^ '-' join: (self substrings collect: [:each | each asLowercase ]) ] + +{ #category : #'*MiniDocs' } +String >> romanizeAccents [ + | modified corrections | + corrections := { + 'ó' -> 'o' . 'ú' -> 'u' . 'ñ' -> 'n' . + 'í' -> 'i' . 'á' -> 'a' . 'é' -> 'e' } asDictionary. + modified := self copy. + corrections keysAndValuesDo: [ :k :v | + modified := modified copyReplaceAll: k with: v + ]. + ^ modified +]