-
Notifications
You must be signed in to change notification settings - Fork 0
/
TestPreprocessing.py
32 lines (28 loc) · 1.01 KB
/
TestPreprocessing.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from Preprocessing import Preprocessing
class TestPreprocessing:
@staticmethod
def main():
path = input('Masukkan path txt yang akan dibaca: ')
if path.lower().endswith('.txt'):
print('File: ' + path)
file = open(path, 'r', encoding="ISO-8859-1")
file_content = file.read()
file.close()
print('Hasil Cleaning:')
result = Preprocessing.cleaning(file_content)
print(result)
print('Hasil Case Folding:')
result = Preprocessing.case_folding(result)
print(result)
print('Hasil Tokenisasi:')
result = Preprocessing.tokenisasi(result)
print(result)
print('Hasil Filtering:')
result = Preprocessing.filtering(result)
print(result)
print('Hasil Stemming:')
result = Preprocessing.stemming(result)
print(result)
else:
print('File tidak valid')
TestPreprocessing().main()