Add files via upload

This commit is contained in:
Eliran Wong 2018-08-22 00:04:03 +01:00 committed by GitHub
parent 481001599e
commit e0e8b45b51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,40 @@
import re
inputFile = 'berean_accented.csv'
outputFile = 'berean_unaccented.csv'
f = open(inputFile,'r')
newData = f.read()
f.close()
# Greek unicode characters
newData = re.sub('[ἀἄᾄἂἆἁἅᾅἃάᾴὰᾶᾷᾳ]', 'α', newData)
newData = re.sub('[ἈἌἎἉἍἋ]', 'Α', newData)
newData = re.sub('[ἐἔἑἕἓέὲ]', 'ε', newData)
newData = re.sub('[ἘἜἙἝἛ]', 'Ε', newData)
newData = re.sub('[ἠἤᾔἢἦᾖᾐἡἥἣἧᾗᾑήῄὴῆῇῃ]', 'η', newData)
newData = re.sub('[ἨἬἪἮἩἭἫ]', 'Η', newData)
newData = re.sub('[ἰἴἶἱἵἳἷίὶῖϊΐῒ]', 'ι', newData)
newData = re.sub('[ἸἼἹἽ]', 'Ι', newData)
newData = re.sub('[ὀὄὂὁὅὃόὸ]', 'ο', newData)
newData = re.sub('[ὈὌὉὍὋ]', 'Ο', newData)
newData = re.sub('[ῥ]', 'ρ', newData)
newData = re.sub('[Ῥ]', 'Ρ', newData)
newData = re.sub('[ὐὔὒὖὑὕὓὗύὺῦϋΰῢ]', 'υ', newData)
newData = re.sub('[ὙὝὟ]', 'Υ', newData)
newData = re.sub('[ὠὤὢὦᾠὡὥὧᾧώῴὼῶῷῳ]', 'ω', newData)
newData = re.sub('[ὨὬὪὮὩὭὯ]', 'Ω', newData)
newData = re.sub("[\-\\,\;\:\\\?\.\·\·\'\\\\\\\«\»\(\)\[\]\{\}\\\\\*\\\\¦]", "", newData)
f = open(outputFile,'w')
f.write(newData)
f.close()