Skip to content

Latest commit

 

History

History
61 lines (45 loc) · 1.3 KB

README.md

File metadata and controls

61 lines (45 loc) · 1.3 KB

Description

Adds diacritical support for Pharo and Squeak Smalltalk.

Installation

From CLI

pi install Diacriticals

From Pharo

EpMonitor disableDuring: [ 
    Metacello new
      onWarningLog;
      repository: 'github://hernanmd/Diacriticals/repository';
      baseline: 'Diacriticals';
      load ].

Install recipe for Baseline

If you want to add the ISO3166 to your Metacello Baselines or Configurations, copy and paste the following expression:

	" ... "
	spec
		baseline: 'Diacriticals' 
		with: [ spec repository: 'github://hernanmd/Diacriticals/repository' ];
	" ... "

Usage examples

Find if a String contains any diacritical character:

'cancion' hasAnyDiacritical. ----> false
'canción' hasAnyDiacritical. ----> true
'á' hasAnyDiacritical. ----> true
'garçon' hasAnyDiacritical. ----> true

Find if a String is "diacritical equivalent" of another one:

'canción' isDiacriticalEquivalentOf: 'cancien' ----> false
'cancion' isDiacriticalEquivalentOf: 'canción' ----> true

Find how many diacritical "replacements" are between two Strings:

'canción' diacriticalMatch: 'cancien' ----> 0.
'canción' diacriticalMatch: 'cancion' ----> 1.
'empêché' diacriticalMatch: 'empeche' ----> 2.