diff options
Diffstat (limited to 'lang')
| -rwxr-xr-x | lang | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -1,14 +1,14 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import sys import langdetect from_stdin = False -if sys.argv[1] == '-': +if sys.argv[1] == "-": f = sys.stdin from_stdin = True else: - f = open(sys.argv[1], 'r') + f = open(sys.argv[1], "r") try: l = sys.argv[2].strip() @@ -32,7 +32,7 @@ if min_p and not l: if strict and not min_p: strict = False - + factory = langdetect.detector_factory.DetectorFactory() factory.load_profile(langdetect.detector_factory.PROFILES_DIRECTORY) @@ -71,5 +71,4 @@ for line in f: print("unk") if not from_stdin: - f.close - + f.close() |
