naufalnashif commited on
Commit
15b606e
1 Parent(s): 41457e8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -51,7 +51,8 @@ def clean_text(text):
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
 
 
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
+ text = re.sub(r'(\w)\1{2,}', r'\1', text)
56
 
57
  return text
58