Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Welsh preprocessing + one change to common.py #63

Merged
merged 16 commits into from
Jan 31, 2019
13 changes: 10 additions & 3 deletions src/corporacreator/preprocessors/cy.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
def cy(client_id, sentence):
"""Cleans up the passed sentence, removing or reformatting invalid data.

"""
Cleans up the passed sentence, removing or reformatting invalid data.
Args:
client_id (str): Client ID of sentence's speaker
sentence (str): Sentence to be cleaned up.

Returns:
(str): Cleaned up sentence. Returning None or a `str` of whitespace flags the sentence as invalid.
"""
# TODO: Clean up cy data
# TODO: geiriau Saesneg / English inspired/pronunced words:
# wallace, celsius, ddiesel, wicipedia, william, chiswell, f., h.

JRMeyer marked this conversation as resolved.
Show resolved Hide resolved
sentence = sentence.replace("’", "'") # fix apostrophes
sentence = sentence.replace("wwna", "wna")
sentence = sentence.replace(" siwr ", " siŵr ")
sentence = sentence.replace("\\tungellog"," ungellog")

return sentence