imorcillo commited on
Commit
ebf21e6
·
verified ·
1 Parent(s): 963b5a3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -43,14 +43,14 @@ def fix_italian_transcription(transcription):
43
  "di autore", "a uomo", "su imperatore", "con amico", "per artista"
44
  }
45
 
46
- transcription = re.sub(r"\b(un|l|d|s|t|m|c|n|quest|all|dall|nell|sull|coll|pell|dov)\s+(?=[aeiouhàèìòùáéíóú])", r"\1'", transcription)
47
  transcription = re.sub(r"\b(s|t|m|c|n)\s+(?=è\b|ha\b|hanno\b)", r"\1'", transcription)
48
  transcription = re.sub(r"\bpo\b", "po'", transcription)
49
  transcription = re.sub(r"\b(senz) ([aeiou])", r"\1'\2", transcription)
50
  transcription = transcription.replace("anch io", "anch'io")
51
 
52
  pattern_numbers = r"\b(trent|quarant|cinquant|sessant|settant|ottant|novant)\s+([aeiouàèìòù])"
53
- replacement_numbers = lambda m: m.group(1)[:-1] + "'" + m.group(2)
54
  transcription = re.sub(pattern_numbers, replacement_numbers, transcription)
55
 
56
  for phrase in no_elision_cases:
 
43
  "di autore", "a uomo", "su imperatore", "con amico", "per artista"
44
  }
45
 
46
+ transcription = re.sub(r"\b(un|l|d|s|t|m|c|n|quest|all|dall|dell|nell|sull|coll|pell|dov)\s+(?=[aeiouhàèìòùáéíóú])", r"\1'", transcription)
47
  transcription = re.sub(r"\b(s|t|m|c|n)\s+(?=è\b|ha\b|hanno\b)", r"\1'", transcription)
48
  transcription = re.sub(r"\bpo\b", "po'", transcription)
49
  transcription = re.sub(r"\b(senz) ([aeiou])", r"\1'\2", transcription)
50
  transcription = transcription.replace("anch io", "anch'io")
51
 
52
  pattern_numbers = r"\b(trent|quarant|cinquant|sessant|settant|ottant|novant)\s+([aeiouàèìòù])"
53
+ replacement_numbers = lambda m: m.group(1) + "'" + m.group(2)
54
  transcription = re.sub(pattern_numbers, replacement_numbers, transcription)
55
 
56
  for phrase in no_elision_cases: