@staticmethod
def preprocess_corpus(corpus=None):
    """Removes newlines and adds padding to punctuation characters."""
    if not corpus:
        return
    for index, entry in enumerate(corpus):
        entry = entry.replace(',', ' ,')
        entry = entry.replace('.', ' .')
        entry = entry.replace('?', ' ?')
        entry = entry.replace('!', ' !')
        corpus[index] = entry
    return corpus
