diff options
| author | Patrick Simianer <patrick@lilt.com> | 2026-02-26 10:05:59 +0000 |
|---|---|---|
| committer | Patrick Simianer <patrick@lilt.com> | 2026-02-26 10:05:59 +0000 |
| commit | b31ace79ea5f6b3f279c544cd3a443d6fbf2a24d (patch) | |
| tree | 31f2b599fa5f6996aeb134390d58deb63eefe04a /lang | |
| parent | 8805e95ae94d798c6441f7e1b72c90e049563f17 (diff) | |
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() |
