fruitpicker01 commited on
Commit
f6892c5
·
verified ·
1 Parent(s): 88b5c06

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py CHANGED
@@ -514,6 +514,15 @@ def correct_dash_usage(text):
514
  # Join the sentences back
515
  text = ' '.join(sentences)
516
 
 
 
 
 
 
 
 
 
 
517
  def restore_yo(text):
518
  morph = pymorphy2.MorphAnalyzer()
519
  words = text.split()
 
514
  # Join the sentences back
515
  text = ' '.join(sentences)
516
 
517
+ # Step 9: Replace common abbreviations and acronyms (Ип -> ИП, Ооо -> ООО, Рф -> РФ)
518
+ text = re.sub(r'\bИп\b', 'ИП', text, flags=re.IGNORECASE)
519
+ text = re.sub(r'\bОоо\b', 'ООО', text, flags=re.IGNORECASE)
520
+ text = re.sub(r'\bРф\b', 'РФ', text, flags=re.IGNORECASE)
521
+
522
+ # Step 10: Replace specific words (пользуйтесь -> пользуйтесь, ею -> ей)
523
+ text = re.sub(r'\bпользовуйтесь\b', 'пользуйтесь', text, flags=re.IGNORECASE)
524
+ text = re.sub(r'\bею\b', 'ей', text, flags=re.IGNORECASE)
525
+
526
  def restore_yo(text):
527
  morph = pymorphy2.MorphAnalyzer()
528
  words = text.split()