Skip to content

Commit 5d07b7a

Browse files
committed
Add corrector for Ukrainian (uk)
1 parent 0df0a28 commit 5d07b7a

File tree

1 file changed

+24
-0
lines changed
  • pywikitools/correctbot/correctors

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from typing import List
2+
3+
from .base import CorrectorBase
4+
from .universal import NoSpaceBeforePunctuationCorrector, QuotationMarkCorrector, UniversalCorrector
5+
6+
7+
class UkrainianCorrector(CorrectorBase, UniversalCorrector, NoSpaceBeforePunctuationCorrector, QuotationMarkCorrector):
8+
"""
9+
Correct Kyrgyz typos:
10+
* Kyrgyz quotations start with « and end with »
11+
* Common corrections from UniversalCorrector and NoSpaceBeforePunctuationCorrector
12+
"""
13+
def correct_quotes(self, text: str) -> str:
14+
"""Ensure correct Ukrainian quotes (example: «quote»)"""
15+
return self._correct_quotes('«', '»', text)
16+
17+
def _suffix_for_print_version(self) -> str:
18+
return "_друк"
19+
20+
def _capitalization_exceptions(self) -> List[str]:
21+
return []
22+
23+
def _missing_spaces_exceptions(self) -> List[str]:
24+
return []

0 commit comments

Comments
 (0)