Merge pull request #1760 from visi0nary/verbose_character_checking

Character checking: be more verbose if something fails
This commit is contained in:
lissyx 2018-12-03 16:06:27 +01:00 committed by GitHub
commit 4c54329ed9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 4 deletions

View File

@ -29,14 +29,18 @@ else:
print("### Reading in the following transcript files: ###") print("### Reading in the following transcript files: ###")
print(inFiles) print(inFiles)
allText = set() allText = set()
for inFile in (inFiles): for inFile in (inFiles):
with open(inFile, 'r') as csvFile: with open(inFile, 'r') as csvFile:
reader = csv.reader(csvFile) reader = csv.reader(csvFile)
for row in reader: try:
allText |= set(str(row[2])) for row in reader:
csvFile.close() allText |= set(str(row[2]))
except IndexError as ie:
print("Your input file",inFile,"is not formatted properly. Check if there are 3 columns with the 3rd containing the transcript")
sys.exit(-1)
finally:
csvFile.close()
print("### The following unique characters were found in your transcripts: ###") print("### The following unique characters were found in your transcripts: ###")
print(list(allText)) print(list(allText))