Skip to content

Commit

Permalink
Fix typos discovered by codespell (#68)
Browse files Browse the repository at this point in the history
Fix typos with https://pypi.org/project/codespell

% codespell --ignore-words-list=avance,delt --skip="dict.txt,*.pyx" --write-changes
  • Loading branch information
cclauss authored Dec 11, 2024
1 parent 28524cc commit e911154
Show file tree
Hide file tree
Showing 27 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion docs/source/soundswallower.js.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ SoundSwallower can be called either from Python (see
case of JavaScript, we use `Emscripten <https://www.emscripten.org>`_
to compile the C library into WebAssembly, which is loaded by a
JavaScript wrapper module. This means that there are certain
idiosyncracies that must be taken into account when using the library,
idiosyncrasies that must be taken into account when using the library,
mostly with respect to deployment and initialization.

Using SoundSwallower on the Web
Expand Down
4 changes: 2 additions & 2 deletions include/soundswallower/alignment.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ alignment_entry_t *alignment_iter_get(alignment_iter_t *itor);
alignment_iter_t *alignment_iter_goto(alignment_iter_t *itor, int pos);

/**
* Retain an alighment
* Retain an alignment
* @memberof alignment_t
*/
alignment_t *alignment_retain(alignment_t *al);
Expand Down Expand Up @@ -209,7 +209,7 @@ alignment_iter_t *alignment_states(alignment_t *al);
const char *alignment_iter_name(alignment_iter_t *itor);

/**
* Get the timing and score information for the current segment of an aligment.
* Get the timing and score information for the current segment of an alignment.
*
* @memberof alignment_iter_t
* @arg start Output pointer for start frame
Expand Down
4 changes: 2 additions & 2 deletions include/soundswallower/bitvec.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ typedef uint32 bitvec_t;
*/
bitvec_t *bitvec_realloc(bitvec_t *vec, /* In: Bit vector to search */
size_t old_len, /* In: Old length */
size_t new_len); /* In: New lenght of above bit vector */
size_t new_len); /* In: New length of above bit vector */
/**
* Free a bit vector.
*/
Expand Down Expand Up @@ -138,7 +138,7 @@ bitvec_t *bitvec_realloc(bitvec_t *vec, /* In: Bit vector to search */
* @return the number of bits being set in vector <code>vec</code>
*/
size_t bitvec_count_set(bitvec_t *vec, /* In: Bit vector to search */
size_t len); /* In: Lenght of above bit vector */
size_t len); /* In: Length of above bit vector */

#ifdef __cplusplus
}
Expand Down
2 changes: 1 addition & 1 deletion include/soundswallower/cmn.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
* Merged from the branch SPHINX3_5_2_RCI_IRII_BRANCH: Put data structure into the cmn_t structure.
*
* Revision 1.11.4.2 2005/10/17 04:45:57 arthchan2003
* Free stuffs in cmn and feat corectly.
* Free stuffs in cmn and feat correctly.
*
* Revision 1.11.4.1 2005/07/05 06:25:08 arthchan2003
* Fixed dox-doc.
Expand Down
2 changes: 1 addition & 1 deletion include/soundswallower/err.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
* @file err.h
* @brief Implementation of logging routines.
*
* Logging, warning, debug and error message output funtionality is provided in this file.
* Logging, warning, debug and error message output functionality is provided in this file.
* Sphinxbase defines several level of logging messages - INFO, WARNING, ERROR, FATAL. By
* default output goes to standard error output.
*
Expand Down
2 changes: 1 addition & 1 deletion include/soundswallower/feat.h
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ int32 feat_s2mfc2feat_live(feat_t *fcb, /**< In: Descriptor from feat_init() */
mfcc_t **uttcep, /**< In: Incoming cepstral buffer */
int32 *inout_ncep, /**< In: Size of incoming buffer.
Out: Number of incoming frames consumed. */
int32 beginutt, /**< In: Begining of utterance flag */
int32 beginutt, /**< In: Beginning of utterance flag */
int32 endutt, /**< In: End of utterance flag */
mfcc_t ***ofeat /**< In: Output feature buffer. See
<strong>VERY IMPORTANT</strong> note
Expand Down
2 changes: 1 addition & 1 deletion include/soundswallower/fsg_history.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ void fsg_history_entry_add(fsg_history_t *h,
*/
void fsg_history_end_frame(fsg_history_t *h);

/* Clear the hitory table */
/* Clear the history table */
void fsg_history_reset(fsg_history_t *h);

/* Return the number of valid entries in the given history table */
Expand Down
4 changes: 2 additions & 2 deletions include/soundswallower/glist.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,13 @@ glist_t glist_add_uint32(glist_t g, /**< a link list */
* Create and prepend a new list node containing a single-precision float.
*/
glist_t glist_add_float32(glist_t g, /**< a link list */
float32 val /**< a float32 vlaue */
float32 val /**< a float32 value */
);
/**
* Create and prepend a new list node containing a double-precision float.
*/
glist_t glist_add_float64(glist_t g, /**< a link list */
float64 val /**< a float64 vlaue */
float64 val /**< a float64 value */
);

/**
Expand Down
2 changes: 1 addition & 1 deletion include/soundswallower/listelem_alloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void __listelem_free__(listelem_alloc_t *le, void *elem, char *file, int line);
#define listelem_free(le, el) __listelem_free__((le), (el), __FILE__, __LINE__)

/**
Print number of allocation, numer of free operation stats
Print number of allocation, number of free operation stats
*/
void listelem_stats(listelem_alloc_t *le);

Expand Down
2 changes: 1 addition & 1 deletion include/soundswallower/s3file.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ char *s3file_copy_nextword(s3file_t *s, const char **ptr);
/**
* Extract values with byteswapping and checksum.
*/
size_t s3file_get(void *buf, /**< In: adddress to write values to. */
size_t s3file_get(void *buf, /**< In: address to write values to. */
size_t el_sz, /**< In: element size */
size_t n_el, /**< In: number of elements */
s3file_t *s);
Expand Down
2 changes: 1 addition & 1 deletion include/soundswallower/yin.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void yin_write(yin_t *pe, int16 const *frame);
* associated with <code>*out_pitch</code>, in Q15
* format (i.e. scaled by 32768). This can be
* interpreted as one minus the probability of voicing.
* @return Non-zero if enough data was avaliable to return a pitch
* @return Non-zero if enough data was available to return a pitch
* estimate, zero otherwise.
*/
int yin_read(yin_t *pe, uint16 *out_period, uint16 *out_bestdiff);
Expand Down
2 changes: 1 addition & 1 deletion js/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ class Endpointer {
* @param {number} config.samprate Sampling rate of the input audio.
* @param {number} config.frame_length Length in seconds of an input
* frame, must be 0.01, 0.02, or 0.03.
* @param {number} config.mode Aggressiveness of voice activity detction,
* @param {number} config.mode Aggressiveness of voice activity detection,
* must be 0, 1, 2, or 3. Higher numbers will create "tighter"
* endpoints at the possible expense of clipping the start of
* utterances.
Expand Down
2 changes: 1 addition & 1 deletion py/soundswallower/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def get_audio_data(input_file: str) -> Tuple[bytes, Optional[int]]:
"""Try to get single-channel audio data in the most portable way
possible.
Currently suports only single-channel WAV and raw audio.
Currently supports only single-channel WAV and raw audio.
Args:
input_file: Path to an audio file.
Expand Down
2 changes: 1 addition & 1 deletion py/soundswallower/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def make_decoder_config(args: argparse.Namespace) -> Config:


def write_config(config: Config, output: Optional[str] = None) -> None:
"""Write the full configuraiton as JSON to output file or standard output."""
"""Write the full configuration as JSON to output file or standard output."""
outfh: Any
if output is not None:
outfh = open(output, "wt")
Expand Down
2 changes: 1 addition & 1 deletion src/acmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ acmod_process_cep(acmod_t *acmod,
inptr = (acmod->feat_outidx + acmod->n_feat_frame) % acmod->n_feat_alloc;
}

/* FIXME: we can't split the last frame drop properly to be on the bounary, so just return */
/* FIXME: we can't split the last frame drop properly to be on the boundary, so just return */
if (inptr + nfeat > acmod->n_feat_alloc && acmod->state == ACMOD_ENDED) {
*inout_n_frames -= ncep;
*inout_cep += ncep;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#define WEBRTC_SPL_MUL_16_U16(a, b) ((int32_t)(int16_t)(a) * (uint16_t)(b))

// clang-format off
// clang-format would choose some identation
// clang-format would choose some indentation
// leading to presubmit error (cpplint.py)
#ifndef WEBRTC_ARCH_ARM_V7
// For ARMv7 platforms, these are inline functions in spl_inl_armv7.h
Expand Down Expand Up @@ -242,7 +242,7 @@ int32_t WebRtcSpl_MinValueW32_mips(const int32_t* vector, size_t length);
// Input:
// - vector : 16-bit input vector.
// - length : Number of samples in vector.
// Ouput:
// Output:
// - max_val : Maximum sample value in `vector`.
// - min_val : Minimum sample value in `vector`.
void WebRtcSpl_MinMaxW16(const int16_t* vector,
Expand Down Expand Up @@ -305,7 +305,7 @@ size_t WebRtcSpl_MaxIndexW32(const int32_t* vector, size_t length);
// - vector : 16-bit input vector.
// - length : Number of samples in vector.
//
// Return value : Index to the mimimum value in vector (if multiple
// Return value : Index to the minimum value in vector (if multiple
// indexes have the minimum, return the first).
size_t WebRtcSpl_MinIndexW16(const int16_t* vector, size_t length);

Expand All @@ -315,7 +315,7 @@ size_t WebRtcSpl_MinIndexW16(const int16_t* vector, size_t length);
// - vector : 32-bit input vector.
// - length : Number of samples in vector.
//
// Return value : Index to the mimimum value in vector (if multiple
// Return value : Index to the minimum value in vector (if multiple
// indexes have the minimum, return the first).
size_t WebRtcSpl_MinIndexW32(const int32_t* vector, size_t length);

Expand Down
2 changes: 1 addition & 1 deletion src/common_audio/signal_processing/min_max_operations.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ int32_t WebRtcSpl_MinValueW32C(const int32_t* vector, size_t length) {

// Index of maximum absolute value in a word16 vector.
size_t WebRtcSpl_MaxAbsIndexW16(const int16_t* vector, size_t length) {
// Use type int for local variables, to accomodate the value of abs(-32768).
// Use type int for local variables, to accommodate the value of abs(-32768).

size_t i = 0, index = 0;
int absolute = 0, maximum = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ decoder_alignment(decoder_t *d)
int32 wid = dict_wordid(d->dict, seg->word);
/* This is actually possible, because of (null) transitions. */
if (wid != BAD_S3WID) {
/* The important thing is that they be continguous. */
/* The important thing is that they be contiguous. */
assert(seg->sf == prev_ef + 1);
prev_ef = seg->ef;
alignment_add_word(al, wid, seg->sf, seg->ef - seg->sf + 1);
Expand Down
4 changes: 2 additions & 2 deletions src/fe_noise.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*/

/* This noise removal algorithm is inspired by the following papers
* Computationally Efficient Speech Enchancement by Spectral Minina Tracking
* Computationally Efficient Speech Enhancement by Spectral Minina Tracking
* by G. Doblinger
*
* Power-Normalized Cepstral Coefficients (PNCC) for Robust Speech Recognition
Expand All @@ -60,7 +60,7 @@
#include <soundswallower/prim_type.h>
#include <soundswallower/strfuncs.h>

/* Noise supression constants */
/* Noise suppression constants */
#define SMOOTH_WINDOW 4
#define LAMBDA_POWER 0.7
#define LAMBDA_A 0.995
Expand Down
2 changes: 1 addition & 1 deletion src/feat.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
* Merged from branch SPHINX3_5_2_RCI_IRII_BRANCH: a, Free buffers correctly. b, Fixed dox-doc.
*
* Revision 1.21.4.3 2005/10/17 04:45:57 arthchan2003
* Free stuffs in cmn and feat corectly.
* Free stuffs in cmn and feat correctly.
*
* Revision 1.21.4.2 2005/09/26 02:19:57 arthchan2003
* Add message to show the directory which the feature is searched for.
Expand Down
2 changes: 1 addition & 1 deletion src/fsg_search.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ fsg_search_init(const char *name,
return NULL;
}

/* Intialize the search history object */
/* Initialize the search history object */
fsgs->history = fsg_history_init(NULL, dict);
fsgs->frame = -1;

Expand Down
2 changes: 1 addition & 1 deletion src/mdef.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ mdef_init(char *mdeffile, int cionly)
return NULL;
}
if (strncmp(buf, MODEL_DEF_VERSION, strlen(MODEL_DEF_VERSION)) != 0)
E_FATAL("Version error: Expecing %s, but read %s\n",
E_FATAL("Version error: Expecting %s, but read %s\n",
MODEL_DEF_VERSION, buf);

/* Read #base phones, #triphones, #senone mappings defined in header */
Expand Down
2 changes: 1 addition & 1 deletion src/ms_gauden.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ gauden_param_read(s3file_t *s,

/* #Codebooks */
if (s3file_get(&n_mgau, sizeof(int32), 1, s) != 1) {
E_ERROR("Failed to read number fo codebooks\n");
E_ERROR("Failed to read number of codebooks\n");
return NULL;
}
*out_n_mgau = n_mgau;
Expand Down
4 changes: 2 additions & 2 deletions src/ps_lattice.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ lattice_hyp(lattice_t *dag, latlink_t *link)

/* Backtrace again to construct hypothesis string. */
ckd_free(dag->hyp_str);
dag->hyp_str = ckd_calloc(1, len + 1); /* extra one incase the hyp is empty */
dag->hyp_str = ckd_calloc(1, len + 1); /* extra one in case the hyp is empty */
c = dag->hyp_str + len - 1;
if (dict_real_word(dag->dict, link->to->basewid)) {
char *wstr = dict_wordstr(dag->dict, link->to->basewid);
Expand Down Expand Up @@ -530,7 +530,7 @@ lattice_seg_next(seg_iter_t *seg)
lattice_seg_free(seg);
return NULL;
} else if (itor->cur == itor->n_links) {
/* Re-use the last link but with the "to" node. */
/* Reuse the last link but with the "to" node. */
lattice_link2itor(seg, itor->links[itor->cur - 1], TRUE);
} else {
lattice_link2itor(seg, itor->links[itor->cur], FALSE);
Expand Down
2 changes: 1 addition & 1 deletion src/rtc_base/checks.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#ifndef RTC_BASE_CHECKS_H_
#define RTC_BASE_CHECKS_H_

// If you for some reson need to know if DCHECKs are on, test the value of
// If you for some reason need to know if DCHECKs are on, test the value of
// RTC_DCHECK_IS_ON. (Test its value, not if it's defined; it'll always be
// defined, to either a true or a false value.)
#if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)
Expand Down
4 changes: 2 additions & 2 deletions src/yin.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ cmn_diff(int16 const *signal, int32 *out_diff, int ndiff)
for (tscale = 0; tscale < 32; ++tscale)
if (ndiff & (1 << (31 - tscale)))
break;
--tscale; /* Avoid teh overflowz. */
--tscale; /* Avoid the overflowz. */
/* printf("tscale is %d (ndiff - 1) << tscale is %d\n",
tscale, (ndiff-1) << tscale); */

Expand Down Expand Up @@ -226,7 +226,7 @@ yin_read(yin_t *pe, uint16 *out_period, uint16 *out_bestdiff)

half_wsize = (pe->wsize - 1) / 2;
/* Without any smoothing, just return the current value (don't
* need to do anything to the current poitner either). */
* need to do anything to the current pointer either). */
if (half_wsize == 0) {
if (pe->endut)
return 0;
Expand Down
2 changes: 1 addition & 1 deletion tests/test_feat_fe.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ main(int argc, char *argv[])
ncep = 1;
nfr = feat_s2mfc2feat_live(fcb, cptr, &ncep, TRUE, FALSE, fptr);
TEST_EQUAL(nfr, 0); /* Not possible to make any frames yet. */
TEST_EQUAL(ncep, 1); /* But we shold have consumed one. */
TEST_EQUAL(ncep, 1); /* But we should have consumed one. */
cptr += ncep;
for (i = 1; i < total_frames - 1; ++i) {
ncep = 1;
Expand Down

0 comments on commit e911154

Please sign in to comment.