Support longer tag names.
[wolnelektury.git] / lib / sortify.py
old mode 100755 (executable)
new mode 100644 (file)
index c64668b..642a540
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 import re
-from slughifi import char_map
+from fnpdjango.utils.text.slughifi import char_map
 
 
 # Specifies diacritics order.
@@ -25,7 +25,7 @@ def sortify(value):
 
         Examples :
 
-        >>> sortify('aa') < sortify('a a') < sortify('ą') < sortify('b')
+        >>> sortify('a a') < sortify('aa') < sortify('ą') < sortify('b')
         True
 
         >>> sortify('ź') < sortify('ż')
@@ -39,6 +39,6 @@ def sortify(value):
     # 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')