Skip to content

Commit

Permalink
Warning about spelling-only columns
Browse files Browse the repository at this point in the history
  • Loading branch information
jsmackie committed Nov 28, 2016
1 parent 88ecded commit 907be02
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
4 changes: 0 additions & 4 deletions corpustools/corpus/io/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,10 +479,6 @@ def data_to_discourse2(corpus_name=None, wav_path=None, annotation_types=None, c
try:
#word_kwargs[at.output_name] = (at.attribute, annotations[at][n][0])
word_kwargs[at.attribute.name] = (at.attribute, annotations[at][n][0])
if at.attribute.att_type == 'tier':
#word_kwargs['_transcription_name'] = at.attribute.name
print('found a tier')
print(at.attribute.name)
except IndexError:
#word_kwargs[at.output_name] = (at.attribute, None)
word_kwargs[at.attribute.name] = (at.attribute, None)
Expand Down
19 changes: 18 additions & 1 deletion corpustools/gui/iogui.py
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,7 @@ def generateKwargs(self):
'No feature file called {} could be found'.format(featurename))
return


kwargs = {'corpus_name': name,
'path': path,
'isDirectory':self.isDirectory,
Expand Down Expand Up @@ -923,13 +924,29 @@ def generateKwargs(self):
kwargs['word_path'] = kwargs.pop('path')
kwargs['phone_path'] = phone_path

if not any(['Transcription' in x.name for x in kwargs['annotation_types']]):
alert = QMessageBox()
alert.setWindowTitle('No transcription selected')
alert.setText('You did not select any transcription column for your corpus. '
'Without transcriptions, you will not be able to use some of PCT\'s analysis '
'functions. Click "OK" if you want to continue without transcriptions. Click '
'"Cancel" to go back.')
alert.addButton('OK', QMessageBox.AcceptRole)
alert.addButton('Cancel', QMessageBox.RejectRole)
alert.exec_()
if alert.buttonRole(alert.clickedButton()) == QMessageBox.RejectRole:
return
else:
kwargs['feature_system_path'] = None

if name in get_corpora_list(self.settings['storage']):
msgBox = QMessageBox(QMessageBox.Warning, "Duplicate name",
"A corpus named '{}' already exists. Overwrite?".format(name), QMessageBox.NoButton, self)
msgBox.addButton("Overwrite", QMessageBox.AcceptRole)
msgBox.addButton("Abort", QMessageBox.RejectRole)
msgBox.addButton("Cancel", QMessageBox.RejectRole)
if msgBox.exec_() != QMessageBox.AcceptRole:
return None

return kwargs

@check_for_errors
Expand Down

0 comments on commit 907be02

Please sign in to comment.