From 03ebb1fe81b1ae439413be93b0aa2355e6e52ba2 Mon Sep 17 00:00:00 2001 From: Houjun Liu Date: Mon, 2 Sep 2024 12:00:57 -0400 Subject: [PATCH] [ci skip] removes non shared options --- batchalign/cli/cli.py | 31 ++++++++++++++++++------------- batchalign/version | 6 +++--- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/batchalign/cli/cli.py b/batchalign/cli/cli.py index 5d930d7..35e3138 100644 --- a/batchalign/cli/cli.py +++ b/batchalign/cli/cli.py @@ -49,15 +49,7 @@ def common_options(f): click.argument("in_dir", type=click.Path(exists=True, file_okay=False)), click.argument("out_dir", - type=click.Path(exists=True, file_okay=False)), - click.option("--lang", - help="sample language in three-letter ISO 3166-1 alpha-3 code", - show_default=True, - default="eng", - type=str), - click.option("-n", "--num_speakers", type=int, - help="number of speakers in the language sample", default=2), - + type=click.Path(exists=True, file_okay=False)) ] options.reverse() @@ -115,8 +107,9 @@ def batchalign(ctx, verbose): @common_options @click.option("--whisper/--rev", default=False, help="For utterance timing recovery, OpenAI Whisper (ASR) instead of Rev.AI (default).") + @click.pass_context -def align(ctx, in_dir, out_dir, lang, num_speakers, whisper, **kwargs): +def align(ctx, in_dir, out_dir, whisper, **kwargs): """Align transcripts against corresponding media files.""" def loader(file): return CHATFile(path=os.path.abspath(file)).doc @@ -124,7 +117,7 @@ def loader(file): def writer(doc, output): CHATFile(doc=doc).write(output) - _dispatch("align", lang, num_speakers, + _dispatch("align", "eng", 1, ["cha"], ctx, in_dir, out_dir, loader, writer, C, @@ -143,6 +136,12 @@ def writer(doc, output): default=False, help="Perform speaker diarization (this flag is ignored with Rev.AI)") @click.option("--wor/--nowor", default=False, help="Should we write word level alignment line? Default to no.") +@click.option("--lang", + help="sample language in three-letter ISO 3166-1 alpha-3 code", + show_default=True, + default="eng", + type=str) +@click.option("-n", "--num_speakers", type=int, help="number of speakers in the language sample", default=2) @click.pass_context def transcribe(ctx, in_dir, out_dir, lang, num_speakers, **kwargs): """Create a transcript from audio files.""" @@ -189,7 +188,7 @@ def writer(doc, output): file_okay=True, dir_okay=False), help="Comma seperated manual lexicon override") @click.pass_context -def morphotag(ctx, in_dir, out_dir, lang, num_speakers, **kwargs): +def morphotag(ctx, in_dir, out_dir, **kwargs): """Perform morphosyntactic analysis on transcripts.""" def loader(file): @@ -213,7 +212,7 @@ def loader(file): def writer(doc, output): CHATFile(doc=doc, special_mor_=doc.ba_special_.get("special_mor_notation", False)).write(output) - _dispatch("morphotag", lang, num_speakers, ["cha"], ctx, + _dispatch("morphotag", "eng", 1, ["cha"], ctx, in_dir, out_dir, loader, writer, C) @@ -222,6 +221,12 @@ def writer(doc, output): @batchalign.command() @common_options +@click.option("--lang", + help="sample language in three-letter ISO 3166-1 alpha-3 code", + show_default=True, + default="eng", + type=str) +@click.option("-n", "--num_speakers", type=int, help="number of speakers in the language sample", default=2) @click.pass_context def utseg(ctx, in_dir, out_dir, lang, num_speakers, **kwargs): """Perform morphosyntactic analysis on transcripts.""" diff --git a/batchalign/version b/batchalign/version index a9e5e18..b848b46 100644 --- a/batchalign/version +++ b/batchalign/version @@ -1,3 +1,3 @@ -0.7.4 -September 2nd, 2024 -Bumping BA Major + Python +0.7.5-alpha.1 +September 3nd, 2024 +Removes unneeded options