예제 #1
0
파일: db.py 프로젝트: lippirk/uwb
 def debug_eprint_all(self) -> None:
     t = self.seen
     with self._lock:
         all_ = t.all()
     u.eprint("====db.all")
     u.eprint_pprint(all_)
     u.eprint("db.all====")
예제 #2
0
파일: db.py 프로젝트: lippirk/uwb
 def get_word_count(self, word: str) -> int:
     t = self.seen
     with self._lock:
         Q = Query()
         q = t.search(Q.word == word)
         lenq = len(q)
         if lenq == 0:
             return 0
         elif lenq == 1:
             return q[0]['count']
         else:
             u.eprint(
                 f"db.py: corrupt data! word '{word}' occured {lenq} times in db, expected 0 or 1"
             )
예제 #3
0
def eprint(x: str) -> None:
    u.eprint(f"test_db.py: {x}")
예제 #4
0
def pp_db() -> None:
    with Db() as db:
        u.eprint_pprint(db.words_with_count())
        u.eprint(f"total words seen = {db.total_words_seen()}")
        u.eprint(f"unique words seen = {db.unique_words_seen()}")
예제 #5
0
def eprint(x: str) -> None:
    u.eprint(f"app.py: {x}")
예제 #6
0
def run():
    atexit.register(lambda: u.eprint("====UWB EXITING====="))
    u.eprint(f"====UWB STARTING [time={u.now_str()}]====")
    #  pp_db()
    collect_words_forever()
예제 #7
0
def eprint(x: str) -> None:
    u.eprint(f"clean.py: {x}")
예제 #8
0
파일: dictionary.py 프로젝트: lippirk/uwb
def eprint(x: str) -> None:
    u.eprint(f"dictionary.py: {x}")
예제 #9
0
파일: reddit.py 프로젝트: lippirk/uwb
def eprint(x: str) -> None:
    u.eprint(f"reddit.py: {x}")