Skip to content

Commit

Permalink
i18n: Special case Czech punctuation
Browse files Browse the repository at this point in the history
See #58
  • Loading branch information
bragefuglseth committed Aug 13, 2024
1 parent 2d3a65b commit ce2e9f3
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/text_generation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,7 @@ pub fn simple(language: Language) -> String {
// Some capitalized letters, punctuation and numbers
pub fn advanced(language: Language) -> String {
match language {
Language::Czech
| Language::Danish
Language::Danish
| Language::English
| Language::German
| Language::Hebrew
Expand Down Expand Up @@ -206,6 +205,23 @@ pub fn advanced(language: Language) -> String {
],
WESTERN_ARABIC_NUMERALS,
),
// See <https://github.com/bragefuglseth/keypunch/issues/58>. The quotation is
// slightly different from above.
Language::Czech => advanced_generic(
&language.to_string(),
" ",
&[
Punctuation::suffix(".", true, 0.6),
Punctuation::suffix(",", false, 1.0),
Punctuation::suffix(";", false, 0.1),
Punctuation::suffix(":", false, 0.2),
Punctuation::suffix("!", true, 0.3),
Punctuation::suffix("?", true, 0.3),
Punctuation::wrapping("„", "”", false, 0.2),
Punctuation::wrapping("(", ")", false, 0.1),
],
WESTERN_ARABIC_NUMERALS,
),
// The French language has a space before certain punctuation marks, and keyboard layouts
// that allow for typing guillemet quotation marks easily.
// See <https://github.com/bragefuglseth/keypunch/issues/47>
Expand Down

0 comments on commit ce2e9f3

Please sign in to comment.