git @ Cat's Eye Technologies Dissociated-Parse / master cleanup.py
master

Tree @master (Download .tar.gz)

cleanup.py @masterraw · history · blame

# Copyright (c) 2021-2024 Chris Pressey, Cat's Eye Technologies
# This file is distributed under the MIT license.  For more information, see
# the file LicenseRef-MIT-X-Dissociated-Parse.txt in the LICENSES directory.
# SPDX-License-Identifier: LicenseRef-MIT-X-Dissociated-Parse

import string
import sys


def main():
    for line in sys.stdin:
        line = line.replace('..', '.')
        line = line.replace('.,', ',')
        line = line.replace(" 's", "'s")
        line = line.replace('..', '.')
        for letter in string.ascii_lowercase:
            line = line.replace(". " + letter, ".  " + letter.upper())
        if line.startswith(', '):
            line = 'Lo' + line
        if 'gloom' in line:
            line = line.rstrip()
            line2 = line.replace('gloomy', 'cheesy')
            line2 = line2.replace('gloom', 'cheese')
            line = line + '  _' + line2 + '_\n'
        sys.stdout.write(line)


if __name__ == '__main__':
    # Brak, I beg to disagree; CHEESE LOG is the log for me!
    main()