Skip to content

Commit

Permalink
remove Building Trie message
Browse files Browse the repository at this point in the history
  • Loading branch information
eroux committed Sep 10, 2024
1 parent 85a3155 commit d987c94
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions botok/tries/trie.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import pickle
import time
from pathlib import Path
import logging

from ..chunks.chunks import TokChunks
from ..vars import HASH, NAMCHE, NO_POS, TSEK, __version__
Expand Down Expand Up @@ -52,15 +53,15 @@ def _load_trie(self):
def _build_trie(self):
"""
"""
print("Building Trie:", flush=True)
logging.debug("Building Trie:")
start = time.time()
self.head.data["_"]["version"] = __version__ # add version in trie
self._populate_trie(self.main_data)

with self.pickled_file.open("wb") as f:
pickle.dump(self.head, f, pickle.HIGHEST_PROTOCOL)
end = time.time()
print("({:.0f} s.)".format(end - start), flush=True)
logging.debug("({:.0f} s.)".format(end - start))

def _populate_trie(self, files):
# first populate the trie with words
Expand All @@ -83,7 +84,7 @@ def _add_one_file(self, in_file, category):
spaces and empty lines are trimmed
a single space(breaks if more than one), a comma or a tab can be used as separators
"""
print("\t" + str(in_file))
logging.debug("\t" + str(in_file))
with in_file.open("r", encoding="utf-8-sig") as f:
lines = self.__clean_lines(f)
for l in lines:
Expand Down

0 comments on commit d987c94

Please sign in to comment.