-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgliba.py
53 lines (34 loc) · 885 Bytes
/
gliba.py
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import time
start_time = time.time()
import random
import numpy as np
import sqlite3
from emoch import *
import asyncio
import pymorphy2
import pymorphy2_dicts_ru
import spacy
from spacy.lang.ru import Russian
from spacy.util import minibatch, compounding
connector = sqlite3.connect('data.db')
cursor = connector.cursor()
import os #
async def get_word(text):
cursor.execute('SELECT out FROM words WHERE inp = (?)', (text,))
rez = cursor.fetchall()
try:
return(rez[0][0])
except:
return
async def emoch_sost():
rez = 0.0
for i in emochii:
rez = rez + emochii[i][0]*emochii[i][1]
print(rez)
return(rez)
async def morhy(text):
pass
async def gharmonium():
pass
#asyncio.run(emoch_sost())
print(f"--- {round((time.time() - start_time),2)} seconds ---")