simplified the script
This commit is contained in:
parent
b498e854c7
commit
b76f429711
|
@ -9,31 +9,27 @@ f.close()
|
||||||
|
|
||||||
# Greek unicode characters
|
# Greek unicode characters
|
||||||
|
|
||||||
newData = re.sub('[ἀἄᾄἂἆἁἅᾅἃάᾴὰᾶᾷᾳ]', 'α', newData)
|
searchReplace = (
|
||||||
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)
|
for search, replace in searchReplace:
|
||||||
|
newData = re.sub(search, replace, newData)
|
||||||
newData = re.sub('[ὠὤὢὦᾠὡὥὧᾧώῴὼῶῷῳ]', 'ω', newData)
|
|
||||||
newData = re.sub('[ὨὬὪὮὩὭὯ]', 'Ω', newData)
|
|
||||||
|
|
||||||
newData = re.sub("[\-\—\,\;\:\\\?\.\·\·\'\‘\’\‹\›\“\”\«\»\(\)\[\]\{\}\⧼\⧽\〈\〉\*\‿\᾽\⇔\¦]", "", newData)
|
|
||||||
|
|
||||||
f = open(outputFile,'w')
|
f = open(outputFile,'w')
|
||||||
f.write(newData)
|
f.write(newData)
|
||||||
|
|
Loading…
Reference in New Issue