Professional Documents
Culture Documents
import re
import codecs
test = r''الرحمن
with codecs.open('G:\Computer\Python-\القرآن الكريمQuraan Ma-Mushkoool.txt', 'r','utf-
8') as sentence:
repeat=0
for words in sentence:
#print (words)
pattern=re.compile(test)
matches=pattern.finditer(words)
for match in matches :
repeat+=1
#print(match)
'''
import os
import codecs
file=codecs.open('G:\Computer\Python-\القرآن الكريمQuraan Mushkoool2.txt', 'r','utf-8')
for x in words :
while s ==True :
print(m)
print(x)
else:
print()
#for s in x:
# print(x)
#for i in range(len(s)):
# print("[", s[i], "]", sep="", end="")
for i in range(len(s)):
print("[", s[i], "]", sep="", end="")
#print() Print newline
for ch in s:
print("<", ch, ">", sep="", end="")
#print() # Print newline
else:
print("word not found")
#print (x)
#for word in sp:
# print ("____________",word,"____________")
# for num in range(286):
# if num==word:
# print ("This is the number of the aya")
# else :
# print (word)'''
'''
import os
import pyarabic.arabrepr as arabrepr
arepr=arabrepr.ArabicRepr()
repr=arepr.repr
harf=""دجحخهعغفقثصطكنتالبيسشظزوةىلرؤءئ
print (harf.split())
klma="الرحمن,"
count=0
rep=0
with open('G:\Computer\Python-\القرآن الكريمQuraan Mushkoool2.txt', encoding='utf-8') as
words:
#while harf:
for x in words:
sp=x.split()
for word in sp:
#print ("____________",word,"____________")
for num in range():
if num==word:
print ("This is the number of the aya")
else :
print (word)