PhonologicalRule#
- class montreal_forced_aligner.db.PhonologicalRule(**kwargs)[source]#
Bases:
BaseDatabase class for storing information about a phonological rule
- Parameters:
id (int) – Primary key
segment (str) – Segment to replace
preceding_context (str) – Context before segment to match
following_context (str) – Context after segment to match
replacement (str) – Replacement of segment
probability (float) – Probability of the rule application
silence_after_probability (float) – Probability of silence following forms with rule application
silence_before_correction (float) – Correction factor for silence before forms with rule application
non_silence_before_correction (float) – Correction factor for non-silence before forms with rule application
pronunciations (list[
RuleApplication]) – List of rule applications
- apply_rule(pronunciation)[source]#
Apply the rule on a pronunciation by replacing any matching segments with the replacement
- property match_regex#
Regular expression of the rule