1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00

feat(ipa): make into filter

This commit is contained in:
Kierán Meinhardt
2020-06-04 13:29:01 +02:00
parent c725ed62b5
commit ac90b48268

View File

@@ -152,7 +152,7 @@ XSAMPA_TO_IPA = {
}
if __name__ == "__main__":
text = " ".join(sys.argv[1:])
text = sys.stdin.read()
for xsampa, ipa in sorted(XSAMPA_TO_IPA.items(), key=lambda item: -len(item[0])):
text = text.replace(xsampa, ipa)