-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
check for header row #73
Merged
Merged
Changes from 18 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
4147b8a
readme
JoFrhwld 638314e
update export script names for backwards compatibility
JoFrhwld d0c2a94
Merge pull request #78 from JoFrhwld/hotfix
JoFrhwld f514fde
incrementing version number
JoFrhwld 913d6c6
removed the link to the mailing group
DerMoehre 614c519
added a bug reporting form
DerMoehre e21cef9
added a link to the bug report form
DerMoehre a865e50
added a description of bug triage
DerMoehre 0a03242
added the changes to the bug report and readme
DerMoehre acbfb43
deleted .code-workspace
DerMoehre 6d95cd9
Delete Documents.code-workspace
DerMoehre 4e38a1e
added the test_readFile and updated the code in read_transcription_fi…
DerMoehre 50bc9b5
added the requested changes
DerMoehre 0836312
Delete test.csv
DerMoehre 2293dba
Delete test_readFile.py
DerMoehre 8e245e3
changes in the transcriptprocessor file
DerMoehre f305e54
added the requested changes
DerMoehre 400a060
added the requested changes
DerMoehre 27c6fde
typo correction
DerMoehre 66611d2
Merge branch 'dev' into master
chrisbrickhouse File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Bug Report | ||
description: The software does something unwanted or unusual | ||
title: "[BUG]: " | ||
labels: ["bug"] | ||
|
||
body: | ||
- type: markdown | ||
attributes: | ||
value: | | ||
Thanks for taking the time to fill out this bug report! | ||
- type: checkboxes | ||
id: new-bug | ||
attributes: | ||
label: Did you search for similar bugs? | ||
description: Please search to see if an issue already exists for the bug you encountered. | ||
options: | ||
- label: I have searched the existing issues | ||
required: false | ||
- type: textarea | ||
id: bug-description | ||
attributes: | ||
label: What happened? | ||
description: Tell us what bug you encountered | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: bug-behaviour | ||
attributes: | ||
label: Expectations? | ||
description: Tell us what should have happened | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: steps-to-reproduce | ||
attributes: | ||
label: Steps To Reproduce | ||
description: Can you describe your steps, when you encountered the bug? | ||
placeholder: Please write the steps in a list form | ||
validations: | ||
required: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
*.wav | ||
build/* | ||
docs/_build | ||
*.code-workspace | ||
*.swp | ||
*.orig | ||
env | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,27 @@ | ||
import logging | ||
import pytest | ||
from fave.align import transcriptprocessor | ||
from fave import cmudictionary # We shouldn't be doing this... | ||
|
||
# Copied from ../test_cmudictionary.py | ||
# which means this really should be made a fixture... | ||
KWARGS = { | ||
'verbose': 1 | ||
} | ||
|
||
CMU_EXCERPT = """ | ||
TEST T EH1 S T | ||
TEST'S T EH1 S T S | ||
TESTA T EH1 S T AH0 | ||
TESTAMENT T EH1 S T AH0 M AH0 N T | ||
TESTAMENTARY T EH2 S T AH0 M EH1 N T ER0 IY0 | ||
TESTED T EH1 S T AH0 D | ||
TESTER T EH1 S T ER0 | ||
TESTERMAN T EH1 S T ER0 M AH0 N | ||
TESTERS T EH1 S T ER0 Z | ||
TESTERS T EH1 S T AH0 Z | ||
""" | ||
|
||
|
||
def test_replace_smart_quotes(): | ||
def test_func( testcase ): | ||
|
@@ -69,3 +91,57 @@ def provide_check_transcription_format_raises_value_error(): | |
# Skip 5 entries (not an error) | ||
[ 'a\tb\tc\td\te\tf', ValueError], # 6 entries | ||
] | ||
|
||
def test_read_transcription_file(tmp_path): | ||
tmp_directory = tmp_path / "transcripts" | ||
tmp_directory.mkdir() | ||
tmp_file = tmp_directory / "test_transcript.csv" | ||
dict_file = tmp_directory / "cmu.dict" | ||
dict_file.write_text(CMU_EXCERPT) | ||
cmu_dict = cmudictionary.CMU_Dictionary(dict_file, **KWARGS) | ||
for test_case in provide_value_error_file(): | ||
test_text = test_case[0] | ||
flags = test_case[1] | ||
expected = test_case[2] | ||
tmp_file.write_text(test_text) | ||
tp_obj = transcriptprocessor.TranscriptProcessor( | ||
tmp_file, | ||
cmu_dict, | ||
**flags | ||
) | ||
tp_obj.read_transcription_file() | ||
|
||
assert tp_obj.lines == expected | ||
|
||
def provide_value_error_file(): | ||
return [ | ||
[ # header row is detected and deleted | ||
"Style\tSpeaker\tBeginning\tEnd\tDuration\nFoo\tBar\t0.0\t3.2\t3.2", | ||
{ | ||
'prompt': "IDK what this is -CJB", | ||
'check' : '', | ||
'verbose': logging.DEBUG | ||
}, | ||
['Foo\tBar\t0.0\t3.2\t3.2'] | ||
], | ||
[ # test with one line | ||
"Foo\tBar\t0.0\t3.2\t3.2\nTest\t1.0\4.5\t3.5", | ||
{ | ||
'prompt': "IDK what this is -CJB", | ||
'check' : '', | ||
'verbose': logging.DEBUG | ||
}, | ||
['Foo\tBar\t0.0\t3.2\t3.2\n', 'Test\t1.0\4.5\t3.5'] | ||
], | ||
[ # test with more lines | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See above. Happens twice in this line and the expected value. |
||
"Foo\tBar\t0.0\t3.2\t3.2\nTest\t1.0\4.5\t3.5\nTest\t1.0\4.5\t3.5", | ||
{ | ||
'prompt': "IDK what this is -CJB", | ||
'check' : '', | ||
'verbose': logging.DEBUG | ||
}, | ||
['Foo\tBar\t0.0\t3.2\t3.2\n', 'Test\t1.0\4.5\t3.5\n', 'Test\t1.0\4.5\t3.5'] | ||
] | ||
|
||
] | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You forgot a tab:
1.0\4.5
should be1.0\t4.5
. Same typo in the expected field (which is why the test passes) and in the following test cases.