Skip to content

Commit

Permalink
Improved greek translit
Browse files Browse the repository at this point in the history
  • Loading branch information
hmlendea committed Jan 26, 2022
1 parent c8db73f commit 5a81e4a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Service/Transliterators/TransliterateDotComTransliterator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ private string ApplyFixes(string text, string language)
fixedText = Regex.Replace(fixedText, "([nrs])mp", "$1v");
fixedText = Regex.Replace(fixedText, "mp([aáioó])", "v$1");
fixedText = Regex.Replace(fixedText, "nknt", "gd");
fixedText = Regex.Replace(fixedText, "nnt", "ng");
fixedText = Regex.Replace(fixedText, "ntm", "dm");
fixedText = Regex.Replace(fixedText, "rnk", "rk");
fixedText = Regex.Replace(fixedText, "rnt", "rd");
Expand All @@ -63,6 +64,10 @@ private string ApplyFixes(string text, string language)
fixedText = Regex.Replace(fixedText, "Agí(a|os)", "Hagí$1");
fixedText = Regex.Replace(fixedText, "polē$", "polis");
fixedText = Regex.Replace(fixedText, "polē ", "polis");

fixedText = Regex.Replace(fixedText, "ín$", "ínon");
fixedText = Regex.Replace(fixedText, "o$", "on");

}
else if (language == "he")
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,14 @@ private string ApplyLanguageSpecificFixes(string text, string language)
fixedText = Regex.Replace(fixedText, "ά", "á");
fixedText = Regex.Replace(fixedText, "[έ]", "é");
fixedText = Regex.Replace(fixedText, "[ίή]", "í");
fixedText = Regex.Replace(fixedText, "[ϊ]", "ï");
fixedText = Regex.Replace(fixedText, "[όώ]", "ó");
fixedText = Regex.Replace(fixedText, "ς", "s");
fixedText = Regex.Replace(fixedText, "ύ", "ú");

fixedText = fixedText.Replace("Mp", "B");
fixedText = fixedText.Replace("Nt", "D");

fixedText = Regex.Replace(fixedText, "([r])nt", "$1d");
fixedText = Regex.Replace(fixedText, "([nrs])mp", "$1b");
}
Expand Down

0 comments on commit 5a81e4a

Please sign in to comment.