Improving accented characters sanitation.
This commit is contained in:
parent
3134d36075
commit
c5ebe99e34
@ -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
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user