From 2eba25c7404343a66595ab51b1fda8a2b217d060 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Sat, 30 Aug 2025 14:55:04 +0200 Subject: [PATCH] Fix typos discovered by codespell --- EN_PHONES.md | 2 +- misaki/he.py | 2 +- misaki/tone_sandhi.py | 2 +- misaki/transcription.py | 2 +- misaki/vi_cleaner/datestime_vi.py | 8 ++++---- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/EN_PHONES.md b/EN_PHONES.md index eb6fdb7..755c977 100644 --- a/EN_PHONES.md +++ b/EN_PHONES.md @@ -37,7 +37,7 @@ Disclaimer: Author is an ML researcher, not a linguist, and may have butchered o - `ʊ`: As in `wood => wˈʊd`. - `ʌ`: As in `sun => sˈʌn`. -**Dipthong Vowels (4)** +**Diphthong Vowels (4)** - `A`: The "eh" vowel sound, like `hey => hˈA`. Expands to `eɪ` in IPA. - `I`: The "eye" vowel sound, like `high => hˈI`. Expands to `aɪ` in IPA. - `W`: The "ow" vowel sound, like `how => hˌW`. Expands to `aʊ` in IPA. diff --git a/misaki/he.py b/misaki/he.py index 99ff29b..6f7687c 100644 --- a/misaki/he.py +++ b/misaki/he.py @@ -9,7 +9,7 @@ def __call__(self, text: str, preserve_punctuation = True, preserve_stress = Tru """ Convert Hebrew text to IPA Text is expected to be with diacritics (niqqud) - Enable debug to return Word objects that contais detailed conversion information + Enable debug to return Word objects that contains detailed conversion information """ return mishkal.phonemize(text, preserve_punctuation=preserve_punctuation, preserve_stress=preserve_stress) diff --git a/misaki/tone_sandhi.py b/misaki/tone_sandhi.py index 9108272..4af4faf 100644 --- a/misaki/tone_sandhi.py +++ b/misaki/tone_sandhi.py @@ -155,7 +155,7 @@ def _yi_sandhi(self, word: str, finals: List[str]) -> List[str]: if word.find(YI) != -1 and all( [item.isnumeric() for item in word if item != YI]): return finals - # "一" between reduplication words shold be yi5, e.g. 看一看 + # "一" between reduplication words should be yi5, e.g. 看一看 elif len(word) == 3 and word[1] == YI and word[0] == word[-1]: finals[1] = finals[1][:-1] + "5" # when "一" is ordinal word, it should be yi1 diff --git a/misaki/transcription.py b/misaki/transcription.py index d1d2e8f..3156aa4 100644 --- a/misaki/transcription.py +++ b/misaki/transcription.py @@ -68,7 +68,7 @@ # Duanmu (2000, p. 37) and Lin (2007, p. 68f) -# Diphtongs from Duanmu (2007, p. 40): au, əu, əi, ai +# Diphthongs from Duanmu (2007, p. 40): au, əu, əi, ai # Diphthongs from Lin (2007, p. 68f): au̯, ou̯, ei̯, ai̯ FINAL_MAPPING: Dict[str, List[Tuple[str, ...]]] = { "a": [("a0",)], # / diff --git a/misaki/vi_cleaner/datestime_vi.py b/misaki/vi_cleaner/datestime_vi.py index 1e3dc4a..fdcd681 100644 --- a/misaki/vi_cleaner/datestime_vi.py +++ b/misaki/vi_cleaner/datestime_vi.py @@ -71,7 +71,7 @@ def _expand_full_date(match): def _expand_range_full_date(match): - prefix, space, day_start, hypen, day_end, seporator1, month, seporator2, year, suffix = match.groups( + prefix, space, day_start, hyphen, day_end, seporator1, month, seporator2, year, suffix = match.groups( 0) space = "" if space == 0 else space day_start = _remove_prefix_zero(day_start) @@ -96,7 +96,7 @@ def _expand_day_month(match): def _expand_range_day_month(match): - prefix, space, day_start, hypen, day_end, seporator1, month, suffix = match.groups( + prefix, space, day_start, hyphen, day_end, seporator1, month, suffix = match.groups( 0) space = "" if space == 0 else space day_start = _remove_prefix_zero(day_start) @@ -133,13 +133,13 @@ def _expand_quarter_month_year(match): def _expand_range_month_year(match): - prefix, space, month_start, hypen, month_end, seporator, year, suffix = match.groups( + prefix, space, month_start, hyphen, month_end, seporator, year, suffix = match.groups( 0) space = "" if space == 0 else space month_start = _remove_prefix_zero(month_start) month_end = _remove_prefix_zero(month_end) year = _remove_prefix_zero(year) - if not _is_valid_date(1, int(month_start)) or not _is_valid_date(1, int(month_end)) or hypen == seporator: + if not _is_valid_date(1, int(month_start)) or not _is_valid_date(1, int(month_end)) or hyphen == seporator: return match.group(0) return space + " tháng " + n2w(month_start) + " đến tháng " + n2w(month_end) + " năm " + n2w(year) + suffix + " "