Add comments explaining how translitcodec *is* used

This commit is contained in:
Christopher Allan Webber 2012-12-14 09:28:44 -06:00
parent c843de8a57
commit cc81b5e55e

View File

@ -15,6 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import re import re
# This import *is* used; see word.encode('tranlit/long') below.
import translitcodec import translitcodec
@ -27,6 +28,7 @@ def slugify(text, delim=u'-'):
""" """
result = [] result = []
for word in _punct_re.split(text.lower()): for word in _punct_re.split(text.lower()):
# Uses translitcodec!
word = word.encode('translit/long') word = word.encode('translit/long')
if word: if word:
result.append(word) result.append(word)