naufalnashif commited on
Commit
41457e8
·
1 Parent(s): 8b93708

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -50,7 +50,8 @@ def clean_text(text):
50
  text = text.lower()
51
 
52
  # Tahap-10: koreksi duplikasi tiga karakter beruntun atau lebih (contoh. yukkk)
53
- text = re.sub(r'([a-zA-Z])\1\1', '\\1', text)
 
54
 
55
  return text
56
 
 
50
  text = text.lower()
51
 
52
  # Tahap-10: koreksi duplikasi tiga karakter beruntun atau lebih (contoh. yukkk)
53
+ # text = re.sub(r'([a-zA-Z])\1\1', '\\1', text)
54
+ text = re.sub(r'(.)(\1{2,})', r'\1\1', text)
55
 
56
  return text
57