youssef1214
commited on
Commit
·
4cc0fe2
1
Parent(s):
2d422c8
Update Database.py
Browse files- Database.py +1 -3
Database.py
CHANGED
@@ -66,7 +66,6 @@ def shakwa_common_words():
|
|
66 |
else:
|
67 |
most_common_words[word] = 1
|
68 |
most_common_words = sorted(most_common_words.items(), key=lambda x: x[1])
|
69 |
-
print(most_common_words)
|
70 |
db.collection("per_day_common_words").add({str(datetime.today().date()):most_common_words})
|
71 |
|
72 |
|
@@ -125,7 +124,6 @@ def on_snapshot(doc_snapshot, changes, read_time):
|
|
125 |
# print(doc.to_dict())
|
126 |
shakw = Classes.Shakwa.from_dict(source=doc.to_dict())
|
127 |
datetime_obj = datetime.strptime(shakw.date, date_format)
|
128 |
-
print(shakw)
|
129 |
if datetime_obj.date() == datetime.today().date() and shakw.id not in documnetskey:
|
130 |
documents.append(shakw)
|
131 |
documnetskey.add(shakw.id)
|
@@ -134,7 +132,7 @@ def on_snapshot(doc_snapshot, changes, read_time):
|
|
134 |
if shakw.summary==None:
|
135 |
queuedUnSummurizedShawkas.append(shakw)
|
136 |
semphoreShakwas.release()
|
137 |
-
threadofcommonwords = threading.Thread(target=
|
138 |
threadofcommonwords.start()
|
139 |
callback_done.set()
|
140 |
|
|
|
66 |
else:
|
67 |
most_common_words[word] = 1
|
68 |
most_common_words = sorted(most_common_words.items(), key=lambda x: x[1])
|
|
|
69 |
db.collection("per_day_common_words").add({str(datetime.today().date()):most_common_words})
|
70 |
|
71 |
|
|
|
124 |
# print(doc.to_dict())
|
125 |
shakw = Classes.Shakwa.from_dict(source=doc.to_dict())
|
126 |
datetime_obj = datetime.strptime(shakw.date, date_format)
|
|
|
127 |
if datetime_obj.date() == datetime.today().date() and shakw.id not in documnetskey:
|
128 |
documents.append(shakw)
|
129 |
documnetskey.add(shakw.id)
|
|
|
132 |
if shakw.summary==None:
|
133 |
queuedUnSummurizedShawkas.append(shakw)
|
134 |
semphoreShakwas.release()
|
135 |
+
threadofcommonwords = threading.Thread(target=shakwa_common_words)
|
136 |
threadofcommonwords.start()
|
137 |
callback_done.set()
|
138 |
|