# -*- coding: utf-8 -*-
import re
-from slughifi import char_map
+from fnpdjango.utils.text.slughifi import char_map
# Specifies diacritics order.
Examples :
- >>> sortify('aa') < sortify('a a') < sortify('ą') < sortify('b')
+ >>> sortify('a a') < sortify('aa') < sortify('ą') < sortify('b')
True
>>> sortify('ź') < sortify('ż')
# try to replace chars
value = re.sub('[^a-zA-Z0-9\\s\\-]{1}', replace_char, value)
value = value.lower()
- value = re.sub(r'[^a-z0-9~]+', '|', value)
+ value = re.sub(r'[^a-z0-9~]+', ' ', value)
return value.encode('ascii', 'ignore')