Getting started with fave-recode

PyPI codecov Maintainability FAVE Python CI Build Docs

The idea behind fave-recode is that no matter how much you may adjust the dictionary of a forced-aligner, you may still want to make programmatic changes to the output.

Installation

You can install fave-recode at your system’s command line with pip.

bash
pip install fave-recode

Basic usage

Installation of the fave-recode python package makes the fave_recode executable, which can also be run at the command line. You can get help with --help

bash
fave_recode --help
Usage: fave_recode [OPTIONS]

Inputs: [at least 1 required]
  File inputs. Either a single file with -i or a path with -p. Not both.
  -i, --input_file FILENAME  single input file
  -p, --input_path PATH      Path to a set of files

Outputs:
  -o, --output_file TEXT     An output file name
  -d, --output_dest PATH     An output directory

Other options:
  -a, --parser TEXT          Label set parser. Built in options are cmu_parser
  -s, --scheme TEXT          Recoding scheme. Built in options are cmu2labov
                             and cmu2phila  [required]
  -r, --recode_stem TEXT     Stem to append to recoded TextGrid file names
  -t, --target_tier TEXT     Target tier to recode
  --help                     Show this message and exit.

To recode a single file, you need to provide fave_recode with, minimally, the input file (the -i flag), and the recoding scheme (with the -s flag). There are a few default recoding schemes that come with fave_recode.

bash
ls data
KY25A_1.TextGrid  josef-fruehwald_speaker.TextGrid
bash
fave_recode \
  -i data/josef-fruehwald_speaker.TextGrid \
  -a cmu_parser \
  -s cmu2phila 

ls data
KY25A_1.TextGrid          josef-fruehwald_speaker_recoded.TextGrid
josef-fruehwald_speaker.TextGrid