Spaces:
Runtime error
Runtime error
Update Sejarah.py
Browse files- Sejarah.py +10 -2
Sejarah.py
CHANGED
@@ -1,7 +1,15 @@
|
|
|
|
|
|
1 |
class Sejarah:
|
2 |
def __init__(self):
|
3 |
self.name = 'Sejarah'
|
4 |
|
5 |
def interface(self, question):
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import langid
|
2 |
+
|
3 |
class Sejarah:
|
4 |
def __init__(self):
|
5 |
self.name = 'Sejarah'
|
6 |
|
7 |
def interface(self, question):
|
8 |
+
language = detect_language(question)
|
9 |
+
answer = "Answer of "+question+" is: "+language
|
10 |
+
return answer
|
11 |
+
|
12 |
+
def detect_language(self, content):
|
13 |
+
lang = langid.classify(content)
|
14 |
+
return lang
|
15 |
+
|