File: reflow.py

package info (click to toggle)
python-pynlpl 1.2.9-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,900 kB
  • sloc: python: 25,677; sh: 73; makefile: 3
file content (25 lines) | stat: -rwxr-xr-x 496 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#! /usr/bin/env python
# -*- coding: utf8 -*-


from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import

import sys
import io
import getopt

from pynlpl.textprocessors import ReflowText


def main():
    for filename in sys.argv[1:]:
        f = io.open(filename, 'r', encoding='utf-8')
        for line in ReflowText(f):
            print(line)
        f.close()

if __name__ == '__main__':
    main()