def main(**kwargs):
    """
    Cmd script of correct. Input text file, output corrected text file.
    :param kwargs: input, a text file object that will be read from. Should contain utf-8 sentence per line
    :param output: a text file object where parsed output will be written. Parsed output will be similar to CSV data
    :type input: text file object in read mode
    :type output: text file object in write mode
    :return:
    """
    m = Corrector()
    no_char = kwargs['no_char'] if 'no_char' in kwargs else False
    if no_char:
        m.enable_char_error(enable=False)
        print('disable char error detect.')

    detail = kwargs['detail'] if 'detail' in kwargs else False
    count = 0
    with open(kwargs['input'], 'r', encoding='utf-8') as fr, open(kwargs['output'], 'w', encoding='utf-8') as fw:
        for line in fr:
            line = line.strip()
            corrected_dict = m.correct(line)
            count += 1
            corrected_sent = corrected_dict.get('target', '')
            errors = corrected_dict.get('errors', '')
            r = corrected_sent
            if errors and detail:
                r = corrected_sent + '\t' + str(errors)
            fw.write(line + '\t' + r + '\n')
        print('{} lines in output'.format(count))

    Cmd script of correct. Input text file, output corrected text file.
    :param kwargs: input, a text file object that will be read from. Should contain utf-8 sentence per line
    :param output: a text file object where parsed output will be written. Parsed output will be similar to CSV data
    :type input: text file object in read mode
    :type output: text file object in write mode
    :return:
    
pycorrector/__main__.py