Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Replace strings solution in Clear category for Remove Accents by ermichin158
STRING_CONVERTION = "éèăơöàeìǹòùẁỳÀÈÌǸÒÙẀỲằẰầẦềỀồỒờỜừỪȁȅȉȍȑȕȀȄȈȌȐȔáćeǵíḱĺḿńóṕŕśúẃýźÁĆÉǴÍḰĹḾŃÓṔŔŚÚẂÝŹắẮấẤếẾốỐớỚứỨőűŐŰâĉêĝĥîĵôŝûŵŷẑÂĈÊĜĤÎĴÔŜÛŴŶẐǎǍčČďĎěĚǧǦȟȞǐǏǰǩǨľĽňŇǒǑřŘšŠťŤǔǓžŽĂĕĔğĞḫḪĭĬŏŎŭŬȃȂȇȆȋȊȏȎȗȖȓȒãÃẽẼĩĨñÑõÕũŨṽṼỹỸẵẴẫẪễỄỗỖỡỠữỮĀāĒēḠḡĪīŌōŪūȲȳḆḇḎḏẖḴḵḺḻṈṉṞṟṮṯẔẕäëḧïoẗüẅẍÿÄËḦÏÖÜẄẌŸåÅůŮẘẙȧȦḃḂċĊḋḊėĖḟḞġĠḣḢİṁṀṅṄȯȮṗṖṙṘṡṠṫṪẇẆẋẊẏẎżŻẠạḄḅḌḍẸẹḤḥỊịḲḳḶḷṂṃṆṇỌọṚṛṢṣṬṭỤụṾṿẈẉỴỵẒẓąĄçÇḑḐęĘģĢḩḨįĮķĶļĻņŅǫǪŗŖşŞţŢųŲảẢẻẺỉỈỏỎủỦỷỶẳẲẩẨểỂổỔởỞửỬặẶậẬệỆộỘợỢựỰ"
STRING_TO_CONVERTION = "eeaooaeinouwyAEINOUWYaAaAeEoOoOuUaeioruAEIORUacegiklmnoprsuwyzACEGIKLMNOPRSUWYZaAaAeEoOoOuUouOUaceghijosuwyzACEGHIJOSUWYZaAcCdDeEgGhHiIjkKlLnNoOrRsStTuUzZAeEgGhHiIoOuUaAeEiIoOuUrRaAeEiInNoOuUvVyYaAaAeEoOoOuUAaEeGgIiOoUuYyBbDdhKkLlNnRrTtZzaehiotuwxyAEHIOUWXYaAuUwyaAbBcCdDeEfFgGhHImMnNoOpPrRsStTwWxXyYzZAaBbDdEeHhIiKkLlMmNnOoRrSsTtUuVvWwYyZzaAcCdDeEgGhHiIkKlLnNoOrRsStTuUaAeEiIoOuUyYaAaAeEoOoOuUaAaAeEoOoOuU"
def checkio(data):
data = data.replace(chr(832), "")
data = data.replace(chr(833), "")
length = len(STRING_CONVERTION)
for index in range(length):
data = data.replace(STRING_CONVERTION[index], STRING_TO_CONVERTION[index])
return data
#These "asserts" using only for self-checking and not necessary for auto-testing
if __name__ == '__main__':
assert checkio(u"préfèrent") == u"preferent"
assert checkio(u"loài trăn lớn") == u"loai tran lon"
print('Done')
Nov. 20, 2015
Comments: