-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrtf_Example.py
More file actions
23 lines (15 loc) · 825 Bytes
/
rtf_Example.py
File metadata and controls
23 lines (15 loc) · 825 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from relative_term_frequency import RelativeTermFrequency
'''Example with DB connection'''
import sqlite3
conn = sqlite3.connect('data/toots.db')
# rtf = RelativeTermFrequency()
# rtf.setDocumentCountFromDb(conn, "2018-03-05 12:57:13.048000+00:00", "2018-06-10 18:00:00.000000+00:00") #Historical Toots
# rtf.setTermCountFromDb(conn, "2018-06-10 18:00:00.000000+00:00", "2018-06-15 00:00:00.000000+00:00") #Recent Toots
# print(rtf.printnScores())
rtf = RelativeTermFrequency()
rtf.setDocumentCountFromDb(conn, "2018-03-05 12:57:13.048000+00:00", "2018-06-15 00:00:00.000000+00:00") #Historical Toots
rtf.setTermCountFromDb(conn, "2018-06-10 08:00:00.000000+00:00", "2018-06-11 08:00:00.000000+00:00") #Recent Toots
print(rtf.printnScores())
rtf.tablePrintScores(5)
# print(rtf.returnScores())
# print(rtf.term_count)