Commits

Alexandru Moșoi  committed 2d948e7

Ie sometimes can be read as e.

  • Participants
  • Parent commits 8b6d152

Comments (0)

Files changed (1)

File analfabet.py

   text = re.sub(ur"(?=\B[^i])i\b", pick((u"i", u"ii")),
                 text, flags=re.UNICODE)
 
+  text = re.sub(ur"\btu\b", "u", text)
+  text = re.sub(ur"\bTu\b", "U", text)
+
+  text = re.sub(ur"ie", pick(("ie", "e")), text)
+  text = re.sub(ur"Ie", pick(("Ie", "i")), text)
+
   text = re.sub(ur"ă|â", r"a", text)
   text = re.sub(ur"Ă|Â", r"A", text)
   text = re.sub(ur"ș|ş", r"sh", text)
   text = re.sub(ur"Ț|Ţ", r"Tz", text)
   text = re.sub(ur"î", r"i", text)
   text = re.sub(ur"Î", r"I", text)
-  text = re.sub(ur"\btu\b", "u", text)
-  text = re.sub(ur"\bTu\b", "U", text)
 
   text = re.sub(ur"([cdlmnprstvCDLMNPRSTV]e)+\b",
                 lambda m: m.group(0)[0::2],