naufalnashif
commited on
Commit
•
a8fe0b7
1
Parent(s):
8850780
Update app.py
Browse files
app.py
CHANGED
@@ -49,6 +49,9 @@ def clean_text(text):
|
|
49 |
# Tahap-9: Konversi teks ke huruf kecil
|
50 |
text = text.lower()
|
51 |
|
|
|
|
|
|
|
52 |
return text
|
53 |
|
54 |
# Membaca kamus kata gaul Salsabila
|
|
|
49 |
# Tahap-9: Konversi teks ke huruf kecil
|
50 |
text = text.lower()
|
51 |
|
52 |
+
# Tahap-10: koreksi duplikasi tiga karakter beruntun atau lebih (contoh. yukkk)
|
53 |
+
text = text.sub(r'([a-zA-Z])\1\1', '\\1', text)
|
54 |
+
|
55 |
return text
|
56 |
|
57 |
# Membaca kamus kata gaul Salsabila
|