Moving functionality from GrafoscopioUtils.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2024-01-03 14:35:46 -05:00
parent 14160ee4ca
commit 3699111416
1 changed files with 13 additions and 0 deletions

View File

@ -1,5 +1,18 @@
Extension { #name : #String }
{ #category : #'*MiniDocs' }
String >> accentedCharactersCorrection [
| modified corrections |
corrections := {
'ó' -> 'ó' . 'ú' -> 'ú' . 'ñ' -> 'ñ' .
'í' -> 'í' . 'á' -> 'á' . 'é' -> 'é' . '’' -> $' asString} asDictionary.
modified := self copy.
corrections keysAndValuesDo: [ :k :v |
modified := modified copyReplaceAll: k with: v
].
^ modified
]
{ #category : #'*MiniDocs' }
String >> asDashedLowercase [
"I convert phrases like 'This is a phrase' into 'this-is-a-phrase'."