-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
elizajasin
committed
Jul 7, 2017
1 parent
19a8964
commit f856318
Showing
10 changed files
with
470 additions
and
148 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
__author__ = 'elizajasin' | ||
|
||
import ReadAndWriteFile as RAWfile | ||
from openpyxl import Workbook | ||
import re | ||
|
||
# Read Data | ||
hadits = RAWfile.readData('hadits_fix.xlsx') | ||
|
||
# Matching Words | ||
classes = [] | ||
for i in range(len(hadits)): | ||
match1 = re.search(r'jangan|larang|tidak boleh|tinggalkan', hadits[i]) | ||
match2 = re.search(r'bacalah|intailah|tunggulah|hendaklah|permudahlah|sembelihlah|ringankanlah|kenalilah|bertanyalah|berikanlah|hamparkanlah|melemparlah|katakanlah|berbicaralah|hijabilah|minumlah|biarkanlah|buanglah|tetaplah|cucilah|istihadlah|ambillah|sisirlah|ikutlah|pergilah|singkirkanlah|takbirlah|jadikanlah|bangunlah|shalatlah|jagalah|bebaskanlah|tunjukkanlah|lepaskanlah|thawaflah|bawalah|dirikanlah|seimbanglah|tundalah|hapuslah|lakukanlah|sempurnakanlah|bergemberilah|ajaklah|serukanlah|jawablah|kembalilah|iqamatlah|berjalanlah|suruhlah|dahulukanlah|makanlah|teruskanlah|jarilah|rukuklah|taatlah|luruskanlah|bertakbirlah|kembalikanlah|ucapkanlah|ulangilah|pulanglah|berdirilah|berilah|mandilah|izinkanlah|terimalah|diamlah|turunlah|turunkanlah|terjadilah|berdoalah|angkatlah|witirlah|tidurlah|shaumlah|kesinilah|bertahallullah|tanyailah|sederhanakanlah|sebutlah|bertakwalah|bersabarlah|berinfaklah|masukkanlah|tolonglah|datangkanlah|cobalah', hadits[i]) | ||
|
||
if match1: | ||
classes.append(3) | ||
elif match2: | ||
classes.append(2) | ||
else: | ||
classes.append(1) | ||
|
||
# Write Classes Result | ||
wb = Workbook() | ||
ws = wb.active | ||
for i in range(len(classes)): | ||
ws.cell(row=i+1, column=1).value = classes[i] | ||
wb.save('result_clustering.xlsx') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
__author__ = 'elizajasin' | ||
|
||
import ReadAndWriteFile as RAWfile | ||
import re | ||
from py2casefold import casefold | ||
|
||
# Read Data | ||
hadits = RAWfile.readData('hadits_fix.xlsx') | ||
|
||
# Matching Words | ||
words = [] | ||
for i in range(len(hadits)): | ||
match = re.search(r'(\w+lah)', hadits[i]) | ||
if match: | ||
if (casefold(match.groups()[0]) not in words): | ||
words.append(casefold(match.groups()[0])) | ||
|
||
# Write Classes Result | ||
file = open('lah_results.txt', 'w') | ||
for i in range(len(words)): | ||
file.write(words[i]+'\n') | ||
file.close() |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
__author__ = 'elizajasin' | ||
|
||
anjuran = open('anjuran.txt', encoding='utf-8', mode='r') | ||
list_anjuran = anjuran.readlines() | ||
anjuran.close() | ||
kbbi = [] | ||
for i in range(len(list_anjuran)): | ||
kbbi.append(list_anjuran[i].strip('\n')) | ||
s = '' | ||
for i in range(len(kbbi)): | ||
s = s+kbbi[i]+'|' | ||
print(s) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
bacalah | ||
tinggalkanlah | ||
intailah | ||
tunggulah | ||
hendaklah | ||
permudahlah | ||
sembelihlah | ||
ringankanlah | ||
kenalilah | ||
bertanyalah | ||
berikanlah | ||
hamparkanlah | ||
melemparlah | ||
katakanlah | ||
berbicaralah | ||
hijabilah | ||
minumlah | ||
biarkanlah | ||
buanglah | ||
tetaplah | ||
cucilah | ||
istihadlah | ||
ambillah | ||
sisirlah | ||
ikutlah | ||
pergilah | ||
singkirkanlah | ||
takbirlah | ||
jadikanlah | ||
bangunlah | ||
shalatlah | ||
jagalah | ||
bebaskanlah | ||
tunjukkanlah | ||
lepaskanlah | ||
thawaflah | ||
bawalah | ||
dirikanlah | ||
seimbanglah | ||
tundalah | ||
hapuslah | ||
lakukanlah | ||
sempurnakanlah | ||
bergemberilah | ||
ajaklah | ||
serukanlah | ||
jawablah | ||
kembalilah | ||
iqamatlah | ||
berjalanlah | ||
suruhlah | ||
dahulukanlah | ||
makanlah | ||
teruskanlah | ||
jarilah | ||
rukuklah | ||
taatlah | ||
luruskanlah | ||
bertakbirlah | ||
kembalikanlah | ||
ucapkanlah | ||
ulangilah | ||
pulanglah | ||
berdirilah | ||
berilah | ||
mandilah | ||
izinkanlah | ||
terimalah | ||
diamlah | ||
turunlah | ||
turunkanlah | ||
terjadilah | ||
berdoalah | ||
angkatlah | ||
witirlah | ||
tidurlah | ||
shaumlah | ||
kesinilah | ||
bertahallullah | ||
tanyailah | ||
sederhanakanlah | ||
sebutlah | ||
bertakwalah | ||
bersabarlah | ||
berinfaklah | ||
masukkanlah | ||
tolonglah | ||
datangkanlah | ||
cobalah |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
adalah | ||
bacalah | ||
rasulullah | ||
allah | ||
ilah | ||
tidaklah | ||
atlah | ||
telah | ||
tinggalkanlah | ||
berkelah | ||
baitullah | ||
intailah | ||
jumlah | ||
tunggulah | ||
celakalah | ||
janganlah | ||
hendaklah | ||
permudahlah | ||
sembelihlah | ||
ringankanlah | ||
kenalilah | ||
bertanyalah | ||
abdullah | ||
berikanlah | ||
kitabullah | ||
setelah | ||
subhaanallah | ||
hamparkanlah | ||
melemparlah | ||
katakanlah | ||
berbicaralah | ||
sebelah | ||
salah | ||
hijabilah | ||
minumlah | ||
dialah | ||
begitulah | ||
ubaidullah | ||
diberikanlah | ||
dicampurlah | ||
biarkanlah | ||
hanyalah | ||
buanglah | ||
seolah | ||
itulah | ||
tetaplah | ||
masalah | ||
cucilah | ||
istihadlah | ||
ambillah | ||
sisirlah | ||
ikutlah | ||
shallallah | ||
membelah | ||
pergilah | ||
singkirkanlah | ||
takbirlah | ||
illallah | ||
inilah | ||
jadikanlah | ||
bangunlah | ||
shalatlah | ||
silah | ||
jagalah | ||
bebaskanlah | ||
tunjukkanlah | ||
lepaskanlah | ||
thawaflah | ||
tentulah | ||
bawalah | ||
akulah | ||
berjalah | ||
dirikanlah | ||
seimbanglah | ||
tundalah | ||
tudalah | ||
hapuslah | ||
lakukanlah | ||
sempurnakanlah | ||
ketahuilah | ||
bergemberilah | ||
mempermasalah | ||
mengalah | ||
ajaklah | ||
serukanlah | ||
shalah | ||
diperintahlah | ||
jawablah | ||
billah | ||
sangatlah | ||
kembalilah | ||
iqamatlah | ||
berjalanlah | ||
kesalah | ||
suruhlah | ||
dahulukanlah | ||
makanlah | ||
teruskanlah | ||
jarilah | ||
rukuklah | ||
taatlah | ||
luruskanlah | ||
bertakbirlah | ||
kembalikanlah | ||
ucapkanlah | ||
ulangilah | ||
belumlah | ||
pulanglah | ||
insyaallah | ||
berdirilah | ||
berilah | ||
mandilah | ||
izinkanlah | ||
dikumandangkanlah | ||
terimalah | ||
diamlah | ||
turunlah | ||
qailulah | ||
datanglah | ||
engkaulah | ||
turunkanlah | ||
terjadilah | ||
berdoalah | ||
radhiyallah | ||
angkatlah | ||
witirlah | ||
tidurlah | ||
shaumlah | ||
kalaulah | ||
kesinilah | ||
bertahallullah | ||
tanyailah | ||
sederhanakanlah | ||
jikalah | ||
sebutlah | ||
bertakwalah | ||
kewalah | ||
bersabarlah | ||
kalimatullah | ||
berinfaklah | ||
masukkanlah | ||
tolonglah | ||
kabilah | ||
sabilillah | ||
datangkanlah | ||
cobalah | ||
hanzhalah |
Binary file not shown.