- 
                Notifications
    
You must be signed in to change notification settings  - Fork 2
 
Allow more flexible char substitutes #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| 
           Also, it would be nice if you add tests for this functionality  | 
    
| 
           Added tests. Please note, however, that I hadn't yet tested my changes locally (I have no tools needed to build C++ Python extensions), so someone needs to run tests before merging (ideally, GitHub Actions; I'll look into it later)  | 
    
| 
           CI works, it just needed apporoval to run for a first-time contributor (now I've changed the settings a bit). Ignore 2.7 tests for now, probably I'll just turn off testing on 2.7. Other tests really fall after your changes (I didn't check, if that were new tests, or some old tests are broken). You can use github codespaces to run tests not locally.  | 
    
| 
           Ok, I'll merge it today  | 
    
(see also: pytries/DAWG-Python#4 )
The Russian (е≈ё) and Ukrainian/Belorussian/Rusyn (г≈ґ) orthographies allow some optional letter usage, but it is generally limited to a single "marked" variation of an "unmarked" letter.
However, the orthographies of other Slavic languages require slightly more sophisticated logic for diacritic restoration. Czech has
u/ú/ůande/é/ě; Slovak haso/ó/ô,a/á/ä, andl/ĺ/ľ; Polish hasz/ź/ż. The Interslavic constructed language even has three "marked" variations of a single letter:e/ę/ě/ė. (not to mention tonal transcription systems used for Southern Slavic languages)My fix is relatively straightforward: allow each element of
replace_charsto be a list instead of a single char. The performance penalty should be negligible and the backward compatibility should be unaffected.(EDIT: I hoped everything to be validated by tests via CI, but apparently it doesn't work currently)