Skip to content

Commit

Permalink
[ND] Fixing all words ND, with collapsing homophones
Browse files Browse the repository at this point in the history
Now calculating ND for all words in the corpus does not crash PCT.
Fixing Problem no 2 in #785
Also, minor change to the file export notification.
  • Loading branch information
stannam committed Nov 17, 2021
1 parent 77e172d commit caaf722
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions corpustools/gui/ndgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ def run(self):
if kwargs['algorithm'] != 'substitution':
results = neighborhood_density_all_words(c, tierdict,
tier_type = kwargs['tier_type'],
sequence_type= kwargs['sequence_type'],
algorithm = kwargs['algorithm'],
output_format = kwargs['output_format'],
max_distance = kwargs['max_distance'],
Expand Down
10 changes: 6 additions & 4 deletions corpustools/gui/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from .helpgui import HelpDialog, get_url
from corpustools.corpus.io import download_binary
from corpustools.exceptions import PCTError
import os

class ProgressDialog(QProgressDialog):
beginCancel = Signal()
Expand Down Expand Up @@ -291,10 +292,11 @@ def export_message(self):
exported_filetype = 'List of contexts'
else:
exported_filetype = 'Results'
QMessageBox.information(self, "{} exported".format(exported_filetype),
"The {} is exported to '{}.'".format(exported_filetype.lower(),
self.saveFileWidget.value()),
QMessageBox.Ok, QMessageBox.Ok)
if os.path.isfile(self.saveFileWidget.value()):
QMessageBox.information(self, "{} exported".format(exported_filetype),
"The {} is exported to '{}.'".format(exported_filetype.lower(),
self.saveFileWidget.value()),
QMessageBox.Ok, QMessageBox.Ok)


class DownloadWorker(FunctionWorker):
Expand Down

0 comments on commit caaf722

Please sign in to comment.