blob: 0b0b20cc9e55c8f60ad75ef62a41f3a4ae44696c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
#!/usr/bin/env python
import polyglot
from polyglot.detect import Detector
import fileinput
for line in fileinput.input():
try:
for lang in Detector(line).languages:
if lang.confidence > 80.0:
print(lang.confidence)
else:
print("??")
break
except polyglot.detect.base.UnknownLanguage:
print("??")
pass
|