#Sed script to convert code page 708 to code page 864 (Bazar Writer 1.0) #Note: You must first convert the file from 708 to 864 and then reverse it #using Harold Hagen's reverse.exe or the revchar command in perl. After #reversing it use PCWrite to flush all the lines to the right. Do this by #marking the whole file with Ctl F5 and then flushing to the right with Ctl F8. #This script has been tested several times but may still contain bugs. # #Addition of space before punctuation s/\./ \./g s/:/ :/g s/)/ )/g #Addition of space before isolated hamzah (193) s// /g #Removal of vowels s///g s///g s///g s///g s///g s///g s///g s///g #197 to 168 (moved from alifs) s///g #all `ayns (217) to medial `ayn (236) s///g #isolated `ayn (236 to 223) s/ / /g s/^ / /g s/ / /g s/ / /g s/ / /g s/ / /g s/ / /g s/ / /g s/ / /g s/ / /g s/ / /g s/ / /g #initial `ayn (236 to 217) s/ / /g s/^//g s///g s///g s///g s///g s///g s///g s///g s///g s///g s///g #final `ayn (236 to 197) s/ / /g # #all ghayns (218) to medial ghayn (247) s///g #isolated ghayn (247 to 238) s/ / /g s/^ / /g s/ / /g s/ / /g s/ / /g s/ / /g s/ / /g s/ / /g s/ / /g s/ / /g s/ / /g s/ / /g #initial ghayn (247 to 218) s/ / /g s/^//g s///g s///g s///g s///g s///g s///g s///g s///g s///g s///g #final ghayn (247 to 237) s/ / /g # #all ha's (231) to medial ha' (244) s///g #initial ha' (244 to 231) s/ / /g s/^//g s///g s///g s///g s///g s///g s///g s///g s///g s///g s///g #final ha' (244 and 231 to 243) s/ / /g s/ / /g s/$//g s/$//g # #All lam alifs to connected lam alifs s///g s///g s///g s///g #Some connected lam alifs to unconnected lam alifs #After dal 207 s//ϙ/g s/Ϛ/ϝ/g s/Ϟ/ϝ/g #After dhal 208 s//Й/g s/К/Н/g s/О/Н/g #After ra' 209 s//љ/g s/њ/ѝ/g s/ў/ѝ/g #After zay 210 s//ҙ/g s/Қ/ҝ/g s/Ҟ/ҝ/g #After waw 232 s//號/g s/蚠/蝟/g s/螠/蝟/g #After alif 199 s//Ǚ/g s/ǚ/ǝ/g s/Ǟ/ǝ/g #After alif with hamzah above 195 s//Ù/g s/Ú/Ý/g s/Þ/Ý/g #After alif with hamzah below (does it exist in 864?) #After alif with maddah 194 s//™/g s/š//g s/ž//g #After hamzah on waw 196 s//ę/g s/Ě/ĝ/g s/Ğ/ĝ/g #After space s/ / /g s/ / /g s/ / /g #All alifs to connected alifs #194 to 162 s///g #195 to 165 s///g #197 to 168 (moved to top) #s///g #199 to 168 s///g #Initial alifs after a space s/ / /g s/ / /g s/ / /g #Initial alifs at beginning of line s/^//g s/^//g s/^//g #Initial alifs after dal (207) s/Ϣ//g s/ϥ//g s/Ϩ//g #Initial alifs after dhal (208) s/Т//g s/Х//g s/Ш//g #Initial alifs after ra' (209) s/Ѣ//g s/ѥ//g s/Ѩ//g #Initial alifs after zay (210) s/Ң//g s/ҥ//g s/Ҩ//g #Initial alifs after waw (232) s///g s///g s///g #Initial alifs after hamzah on waw (196) s/Ģ//g s/ĥ//g s/Ĩ//g #Final letters (space follows) s/ / /g s/ / /g s/ / /g s/ / /g s/ / /g s/ / /g s/ / /g s/ / /g s/ / /g s/ / /g s/ / /g s/ / /g s/ / /g s/ / /g s/ / /g s/ / /g s/ / /g #Final letters (end of line, no space) s/ $/ /g s/$//g s/$//g s/$//g s/$//g s/$//g s/$//g s/$//g s/$//g s/$//g s/$//g s/$//g s/$//g s/$//g s/$//g s/$//g s/$//g #Connected (final) alif maqsurah (233 to 245) s/ / /g s/$//g #Connected final ya' (234 to 246) s/ / /g s/$//g #Connected final ya' to unconnected final ya' (246 to 253) s/ / /g s/^ / /g s/ / /g s/ / /g s/ / /g s/ / /g s/ / /g s/ / /g s/ / /g s/ / /g s/ / /g s/ / /g #Connected final ya' to unconnected final ya' at end of line s/ $/ /g s/^$//g s/$//g s/$//g s/$//g s/$//g s/$//g s/$//g s/$//g s/$//g s/$//g s/$//g #Connected alif maqsurah to unconnected alif maqsurah (245 to 233) s/ / /g s/^ / /g s/ / /g s/ / /g s/ / /g s/ / /g s/ / /g s/ / /g s/ / /g s/ / /g s/ / /g s/ / /g #Connected alif maqsurah to unconnected alif maqsurah at end of line s/ $/ /g s/^$//g s/$//g s/$//g s/$//g s/$//g s/$//g s/$//g s/$//g s/$//g s/$//g s/$//g #Removal of spaces before punctuation s/ \./\./g s/ :/:/g s/ )/)/g #Removal of spaces before isolated hamzah (193) s/ //g #Parentheses reversal s/(/((/g s/)/))/g s/((/)/g s/))/(/g #Numbers s/0//g s/1//g s/2//g s/3//g s/4//g s/5//g s/6//g s/7//g s/8//g s/9//g #Punctuation s/,//g s/?//g s/;//g s///g