Skip to content
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

Added badges to README.md #80

Merged
merged 25 commits into from
Oct 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
4147b8a
readme
JoFrhwld Sep 22, 2022
638314e
update export script names for backwards compatibility
JoFrhwld Oct 4, 2022
d0c2a94
Merge pull request #78 from JoFrhwld/hotfix
JoFrhwld Oct 4, 2022
f514fde
incrementing version number
JoFrhwld Oct 4, 2022
913d6c6
removed the link to the mailing group
DerMoehre Sep 29, 2022
614c519
added a bug reporting form
DerMoehre Sep 30, 2022
e21cef9
added a link to the bug report form
DerMoehre Sep 30, 2022
a865e50
added a description of bug triage
DerMoehre Sep 30, 2022
0a03242
added the changes to the bug report and readme
DerMoehre Oct 1, 2022
acbfb43
deleted .code-workspace
DerMoehre Oct 2, 2022
6d95cd9
Delete Documents.code-workspace
DerMoehre Oct 2, 2022
4e38a1e
added the test_readFile and updated the code in read_transcription_fi…
DerMoehre Oct 3, 2022
50bc9b5
added the requested changes
DerMoehre Oct 5, 2022
0836312
Delete test.csv
DerMoehre Oct 3, 2022
2293dba
Delete test_readFile.py
DerMoehre Oct 5, 2022
8e245e3
changes in the transcriptprocessor file
DerMoehre Oct 5, 2022
f305e54
added the requested changes
DerMoehre Oct 5, 2022
400a060
added the requested changes
DerMoehre Oct 5, 2022
27c6fde
typo correction
DerMoehre Oct 6, 2022
66611d2
Merge branch 'dev' into master
chrisbrickhouse Oct 6, 2022
58b1add
added license and python badge
DerMoehre Oct 9, 2022
0ac55f5
Merge branch 'master' of https://github.com/DerMoehre/FAVE
DerMoehre Oct 9, 2022
5983ed6
added a test for extractFormants
DerMoehre Oct 9, 2022
e873ea2
Revert "added a test for extractFormants"
DerMoehre Oct 10, 2022
5c62587
added shields badges for PyPI and DOI
DerMoehre Oct 10, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ You can fill in a bug report at the [issue tab](https://github.com/JoFrhwld/FAVE
There may be a delay between when a bug is reported and when a bug is resolved. Developers prioritize bugs based on difficulty, importance, and other factors, so bug reports are usually not handled in the order they are received.

## Attribution
[![DOI](https://zenodo.org/badge/doi/10.5281/zenodo.22281.svg)](http://dx.doi.org/10.5281/zenodo.22281)
[![DOI](https://zenodo.org/badge/13744621.svg)](https://zenodo.org/badge/latestdoi/13744621)
![GitHub](https://img.shields.io/github/license/JoFrhwld/FAVE)
![GitHub](https://img.shields.io/badge/Python-3.8%2B-brightgreen)
[![PyPI version fury.io](https://badge.fury.io/py/fave.svg)](https://pypi.python.org/pypi/fave/)

As of v1.1.3 onwards, releases from this repository will have a DOI associated with them through Zenodo. The DOI for the current release is [10.5281/zenodo.22281](http://dx.doi.org/10.5281/zenodo.22281). We would recommend the citation:

Rosenfelder, Ingrid; Fruehwald, Josef; Brickhouse, Christian; Evanini, Keelan; Seyfarth, Scott; Gorman, Kyle; Prichard, Hilary; Yuan, Jiahong; 2022. FAVE (Forced Alignment and Vowel Extraction) Program Suite v2.0.0 */zenodo.*
Expand Down
8 changes: 7 additions & 1 deletion fave/align/transcriptprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,13 @@ def read_transcription_file(self):
"""Reads file into memory"""
with open(self.file) as f:
lines = self.replace_smart_quotes(f.readlines())
self.lines = lines
self.lines = lines
try:
float(lines[0].split('\t')[2])
except ValueError:
# Log a warning about having detected a header row
self.logger.warning('Header row was detected')
del lines[0]

# substitute any 'smart' quotes in the input file with the corresponding
# ASCII equivalents (otherwise they will be excluded as out-of-
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "fave"
version = "2.0.2-dev"
version = "2.0.3-dev"
description = "Forced alignment and vowel extraction"
authors = [
"Ingrid Rosenfelder",
Expand Down Expand Up @@ -35,3 +35,5 @@ build-backend = "poetry.masonry.api"
[tool.poetry.scripts]
fave-extract = "fave.extractFormants:main"
fave-align = "fave.FAAValign:setup"
extractFormants = "fave.extractFormants:main"
FAAValign = "fave.FAAValign:setup"
76 changes: 76 additions & 0 deletions tests/fave/align/test_transcriptprocessor.py
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 ):
Expand Down Expand Up @@ -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\t4.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\t4.5\t3.5']
],
[ # test with more lines
"Foo\tBar\t0.0\t3.2\t3.2\nTest\t1.0\t4.5\t3.5\nTest\t1.0\t4.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\t4.5\t3.5\n', 'Test\t1.0\t4.5\t3.5']
]

]