Created
February 28, 2011 08:15
-
-
Save lionelB/847071 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.lafabrick.utils | |
{ | |
public class Lemme | |
{ | |
public function Lemme() | |
{ | |
super(); | |
} | |
public static function lematize( s : String ) : String | |
{ | |
var accents : String = "ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïðòóôõöùúûüýÿñ"; | |
var no_accent : String = "aaaaaaceeeeiiiiooooouuuuyaaaaaaceeeeiiiioooooouuuuyyn"; | |
var aAcc: Array = accents.split(''); | |
var aNoAcc: Array = no_accent.split(''); | |
for(var i:Number=0 , n : Number = accents.length ; i< n ; i++) | |
{ | |
s = s.split(aAcc[i]).join(aNoAcc[i]); | |
} | |
return s.toLowerCase(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment