calc_freq_of_alt¶
- corpustools.freqalt.freq_of_alt.calc_freq_of_alt(corpus_context, seg1, seg2, algorithm, output_filename=None, min_rel=None, max_rel=None, phono_align=False, min_pairs_okay=False, stop_check=None, call_back=None)[source]¶
Returns a double that is a measure of the frequency of alternation of two sounds in a given corpus
- Parameters
- corpus_contextCorpusContext
Context manager for a corpus
- seg1: char
A sound segment, e.g. ‘s’, ‘t’
- seg2: char
A sound segment
- algorithm: string
The string similarity algorithm
- max_rel: double
Filters out all words that are higher than max_rel from a relatedness measure
- min_rel: double
Filters out all words that are lower than min_rel from a relatedness measure
- phono_align: boolean (1 or 0), optional
1 means ‘only count alternations that are likely phonologically aligned,’ defaults to not force phonological alignment
- min_pairs_okay: bool, optional
True means allow minimal pairs (e.g. in English, ‘s’ and ‘t’ do not alternate in minimal pairs, so allowing minimal pairs may skew results)
- stop_checkcallable, optional
Optional function to check whether to gracefully terminate early
- call_backcallable, optional
Optional function to supply progress information during the function
- Returns
- double
The frequency of alternation of two sounds in a given corpus