imorcillo commited on
Commit
d6bbe47
·
verified ·
1 Parent(s): e04575a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -43,12 +43,12 @@ 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)\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
 
51
- pattern_numbers = r"\b(trenta|quaranta|cinquanta|sessanta|settanta|ottanta|novanta)\s+(anni|ore)\b"
52
  replacement_numbers = lambda m: m.group(1)[:-1] + "’" + m.group(2)
53
  transcription = re.sub(pattern_numbers, replacement_numbers, transcription)
54
 
 
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
 
51
+ pattern_numbers = r"\b(trent|quarant|cinquant|sessant|settant|ottant|novant)\s+([aeiouàèìòù]])\b"
52
  replacement_numbers = lambda m: m.group(1)[:-1] + "’" + m.group(2)
53
  transcription = re.sub(pattern_numbers, replacement_numbers, transcription)
54