diff --git a/orangecontrib/text/widgets/owcorpusviewer.py b/orangecontrib/text/widgets/owcorpusviewer.py index ef18fdaef..adb4f0440 100644 --- a/orangecontrib/text/widgets/owcorpusviewer.py +++ b/orangecontrib/text/widgets/owcorpusviewer.py @@ -604,7 +604,7 @@ def refresh_search(self): def on_done(self, res: int): """When matches count is done show the result in the label""" - self.n_matches = res if res is not None else "n/a" + self.n_matches = f"{int(res):,}" if res is not None else "n/a" def on_exception(self, ex): raise ex @@ -613,8 +613,8 @@ def update_info(self): if self.corpus is not None: has_tokens = self.corpus.has_tokens() self.n_matching = f"{self.doc_list.model().rowCount()}/{len(self.corpus)}" - self.n_tokens = self.corpus.count_tokens() if has_tokens else "n/a" - self.n_types = self.corpus.count_unique_tokens() if has_tokens else "n/a" + self.n_tokens = f"{int(self.corpus.count_tokens()):,}" if has_tokens else "n/a" + self.n_types = f"{int(self.corpus.count_unique_tokens()):,}" if has_tokens else "n/a" else: self.n_matching = "n/a" self.n_matches = "n/a" diff --git a/orangecontrib/text/widgets/owpreprocess.py b/orangecontrib/text/widgets/owpreprocess.py index 19265c086..c2c6695be 100644 --- a/orangecontrib/text/widgets/owpreprocess.py +++ b/orangecontrib/text/widgets/owpreprocess.py @@ -1338,7 +1338,7 @@ def update_preview(self, data): self.preview = ", ".join(tokens[:5]) n_tokens = data.count_tokens() if data.has_tokens() else '' n_types = data.count_unique_tokens() if data.has_tokens() else '' - self.output_info = f"Tokens: {n_tokens}\nTypes: {n_types}" + self.output_info = f"Tokens: {n_tokens:,}\nTypes: {n_types:,}" except StopIteration: self.preview = "" self.output_info = ""