mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2025-12-06 00:43:00 +01:00
Fix translit.
This commit is contained in:
parent
4335900aa5
commit
eb8a5b2c68
1 changed files with 5 additions and 1 deletions
|
|
@ -2,6 +2,10 @@
|
|||
# Code taken from http://python.su/forum/viewtopic.php?pid=66946
|
||||
from __future__ import absolute_import
|
||||
|
||||
# py2 vs py3 transition
|
||||
from .six import text_type as unicode
|
||||
from .six import ensure_text
|
||||
|
||||
import unicodedata
|
||||
def is_syllable(letter):
|
||||
syllables = ("A", "E", "I", "O", "U", "a", "e", "i", "o", "u")
|
||||
|
|
@ -39,7 +43,7 @@ def romanize(letter):
|
|||
return func(filter(is_consonant, unid))
|
||||
def translit(text):
|
||||
output = ""
|
||||
for letter in text:
|
||||
for letter in ensure_text(text):
|
||||
output += romanize(letter)
|
||||
return output
|
||||
#def main():
|
||||
|
|
|
|||
Loading…
Reference in a new issue