Skip to content
This repository was archived by the owner on Nov 11, 2021. It is now read-only.

Commit 1863f02

Browse files
committed
Applied 'e' rule also to belarusian and bulgarian
1 parent 4004965 commit 1863f02

File tree

4 files changed

+56
-74
lines changed

4 files changed

+56
-74
lines changed

docs/translators/bg.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The conversion from cyrillic to latin follows the [GOST 7.79-2000](https://en.wi
4444
| КС | X | |
4545
| Ы | Y | |
4646
| Я | YA | |
47-
| Е | YE | |
47+
| Е | E | |
4848
| Ю | YU | |
4949
| З | Z | |
5050
|| $ | |
@@ -62,7 +62,7 @@ The conversion from cyrillic to latin follows the [GOST 7.79-2000](https://en.wi
6262
| CH | Ч | |
6363
| Ч | CH | |
6464
| D | Д | |
65-
| E | Э | |
65+
| E | Е | |
6666
| F | Ф | |
6767
| G | Г | |
6868
| G | ДЖ | If g is followed by Y, E, I |

docs/translators/by.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The conversion from cyrillic to latin follows the [GOST 7.79-2000](https://en.wi
4444
| КС | X | |
4545
| Ы | Y | |
4646
| Я | YA | |
47-
| Е | YE | |
47+
| Е | E | |
4848
| Ю | YU | |
4949
| З | Z | |
5050
|| $ | |
@@ -62,7 +62,7 @@ The conversion from cyrillic to latin follows the [GOST 7.79-2000](https://en.wi
6262
| CH | Ч | |
6363
| Ч | CH | |
6464
| D | Д | |
65-
| E | Э | |
65+
| E | Е | |
6666
| F | Ф | |
6767
| G | Г | |
6868
| G | ДЖ | If g is followed by Y, E, I |

src/translator/lang/belarusian.rs

Lines changed: 26 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ impl Translator for Belarusian {
8383
'г' => "g",
8484
'Д' => "D",
8585
'д' => "d",
86-
'Е' => "YE",
87-
'е' => "ye",
86+
'Е' => "E",
87+
'е' => "e",
8888
'Э' => "E",
8989
'э' => "e",
9090
'Ё' => "YO",
@@ -304,8 +304,8 @@ impl Translator for Belarusian {
304304
},
305305
'D' => "Д",
306306
'd' => "д",
307-
'E' => "Э",
308-
'e' => "э",
307+
'E' => "Е",
308+
'e' => "е",
309309
'F' => "Ф",
310310
'f' => "ф",
311311
'G' => match input.chars().nth(i + 1) {
@@ -476,32 +476,32 @@ impl Translator for Belarusian {
476476
println!("\"{}\" => \"{}\"", input, output);
477477
assert_eq!(output, "ls -l");
478478
//Echo hello
479-
let input: String = String::from("экхо хэлло");
479+
let input: String = String::from("екхо хелло");
480480
let output = translator.to_latin(&input);
481481
println!("\"{}\" => \"{}\"", input, output);
482482
assert_eq!(output, "echo hello");
483483
//K vs C
484-
let input: String = String::from("іфконфіг этх0 аддрэсс 192.168.1.30 нэтмаскʼ 255.255.255.0"); //Use твёрдый знак to force k in netmask
484+
let input: String = String::from("іфконфіг етх0 аддресс 192.168.1.30 нетмаскʼ 255.255.255.0"); //Use твёрдый знак to force k in netmask
485485
let output = translator.to_latin(&input);
486486
println!("\"{}\" => \"{}\"", input, output);
487487
assert_eq!(
488488
output,
489489
"ifconfig eth0 address 192.168.1.30 netmask 255.255.255.0"
490490
);
491-
let input: String = String::from("кат РЭАДМЭ.мд");
491+
let input: String = String::from("кат РЕАДМЕ.мд");
492492
let output = translator.to_latin(&input);
493493
println!("\"{}\" => \"{}\"", input, output);
494494
assert_eq!(output, "cat README.md");
495495
//Test all letters (Lowercase)
496-
let input: String = String::from("абкьдэфгхіжйкʼлмнопкюрстуввьксызшёюячцў");
496+
let input: String = String::from("абкьдэефгхіжйкʼлмнопкюрстуввьксызшёюячцў");
497497
let output = translator.to_latin(&input);
498498
println!("\"{}\" => \"{}\"", input, output);
499-
assert_eq!(output, "abcdefghijjklmnopqrstuvwxyzshyoyuyachzu");
499+
assert_eq!(output, "abcdeefghijjklmnopqrstuvwxyzshyoyuyachzu");
500500
//Test all letters (Uppercase)
501-
let input: String = String::from("АБКЬДЭФГХІЖЙКʼЛМНОПКЮРСТУВВЬКСЫЗШЁЮЯЧЦЎ");
501+
let input: String = String::from("АБКЬДЕЭФГХІЖЙКʼЛМНОПКЮРСТУВВЬКСЫЗШЁЮЯЧЦЎ");
502502
let output = translator.to_latin(&input);
503503
println!("\"{}\" => \"{}\"", input, output);
504-
assert_eq!(output, "ABCDEFGHIJJKLMNOPQRSTUVWXYZSHYOYUYACHZU");
504+
assert_eq!(output, "ABCDEEFGHIJJKLMNOPQRSTUVWXYZSHYOYUYACHZU");
505505
//Special cases 'Q'
506506
let input: String = String::from("москюуітто_пуб");
507507
let output = translator.to_latin(&input);
@@ -520,30 +520,21 @@ impl Translator for Belarusian {
520520
let output = translator.to_latin(&input);
521521
println!("\"{}\" => \"{}\"", input, output);
522522
assert_eq!(output, "SRV");
523-
//Special case: Ye
524-
let input: String = String::from("елл");
525-
let output = translator.to_latin(&input);
526-
println!("\"{}\" => \"{}\"", input, output);
527-
assert_eq!(output, "yell");
528-
let input: String = String::from("ЕЛЛ");
529-
let output = translator.to_latin(&input);
530-
println!("\"{}\" => \"{}\"", input, output);
531-
assert_eq!(output, "YELL");
532523
//Special case: ck
533-
let input: String = String::from("чэкк чэкк");
524+
let input: String = String::from("чекк чэкк");
534525
let output = translator.to_latin(&input);
535526
println!("\"{}\" => \"{}\"", input, output);
536527
assert_eq!(output, "check check");
537-
let input: String = String::from("ЧЭКК ЧЭКК");
528+
let input: String = String::from("ЧЕКК ЧЭКК");
538529
let output = translator.to_latin(&input);
539530
println!("\"{}\" => \"{}\"", input, output);
540531
assert_eq!(output, "CHECK CHECK");
541532
//Special case: k as last character which becomes 'c'
542-
let input: String = String::from("рэк к к");
533+
let input: String = String::from("рек к к");
543534
let output = translator.to_latin(&input);
544535
println!("\"{}\" => \"{}\"", input, output);
545536
assert_eq!(output, "rec k k");
546-
let input: String = String::from("РЭК К К");
537+
let input: String = String::from("РЕК К К");
547538
let output = translator.to_latin(&input);
548539
println!("\"{}\" => \"{}\"", input, output);
549540
assert_eq!(output, "REC K K");
@@ -612,24 +603,24 @@ impl Translator for Belarusian {
612603
println!("\"{}\" => \"{}\"", input, output);
613604
assert_eq!(
614605
output,
615-
"а б к д э ф г х і ж к л м н о п кю р с т у в ў кс ы з"
606+
"а б к д е ф г х і ж к л м н о п кю р с т у в ў кс ы з"
616607
);
617608
let input: String = String::from("A B C D E F G H I J K L M N O P Q R S T U V W X Y Z");
618609
let output = translator.to_cyrillic(&input);
619610
println!("\"{}\" => \"{}\"", input, output);
620611
assert_eq!(
621612
output,
622-
"А Б К Д Э Ф Г Х І Ж К Л М Н О П КЮ Р С Т У В Ў КС Ы З"
613+
"А Б К Д Е Ф Г Х І Ж К Л М Н О П КЮ Р С Т У В Ў КС Ы З"
623614
);
624615
//Test particular case (sh)
625616
let input: String = String::from("shell");
626617
let output = translator.to_cyrillic(&input);
627618
println!("\"{}\" => \"{}\"", input, output);
628-
assert_eq!(output, "шэлл");
619+
assert_eq!(output, "шелл");
629620
let input: String = String::from("SHELL");
630621
let output = translator.to_cyrillic(&input);
631622
println!("\"{}\" => \"{}\"", input, output);
632-
assert_eq!(output, "ШЭЛЛ");
623+
assert_eq!(output, "ШЕЛЛ");
633624
//Test particular case (jo)
634625
let input: String = String::from("Option");
635626
let output = translator.to_cyrillic(&input);
@@ -652,11 +643,11 @@ impl Translator for Belarusian {
652643
let input: String = String::from("gin and games");
653644
let output = translator.to_cyrillic(&input);
654645
println!("\"{}\" => \"{}\"", input, output);
655-
assert_eq!(output, "джін анд гамэс");
646+
assert_eq!(output, "джін анд гамес");
656647
let input: String = String::from("GIN AND GAMES");
657648
let output = translator.to_cyrillic(&input);
658649
println!("\"{}\" => \"{}\"", input, output);
659-
assert_eq!(output, "ДЖІН АНД ГАМЭС");
650+
assert_eq!(output, "ДЖІН АНД ГАМЕС");
660651
//Test particular case (iu)
661652
let input: String = String::from("iuta");
662653
let output = translator.to_cyrillic(&input);
@@ -688,16 +679,16 @@ impl Translator for Belarusian {
688679
let input: String = String::from("channel");
689680
let output = translator.to_cyrillic(&input);
690681
println!("\"{}\" => \"{}\"", input, output);
691-
assert_eq!(output, "чаннэл");
682+
assert_eq!(output, "чаннел");
692683
let input: String = String::from("CHANNEL");
693684
let output = translator.to_cyrillic(&input);
694685
println!("\"{}\" => \"{}\"", input, output);
695-
assert_eq!(output, "ЧАННЭЛ");
686+
assert_eq!(output, "ЧАННЕЛ");
696687
//Test some words
697688
let input: String = String::from("Usage: cat [OPTION]... [FILE]...");
698689
let output = translator.to_cyrillic(&input);
699690
println!("\"{}\" => \"{}\"", input, output);
700-
assert_eq!(output, "Усаджэ: кат [ОПТЁН]... [ФІЛЭ]...");
691+
assert_eq!(output, "Усадже: кат [ОПТЁН]... [ФІЛЕ]...");
701692
//Special cases: last character is 'c'
702693
let input: String = String::from("chic");
703694
let output = translator.to_cyrillic(&input);
@@ -729,11 +720,11 @@ impl Translator for Belarusian {
729720
let input: String = String::from("less");
730721
let output = translator.to_cyrillic(&input);
731722
println!("\"{}\" => \"{}\"", input, output);
732-
assert_eq!(output, "лэсс");
723+
assert_eq!(output, "лесс");
733724
let input: String = String::from("LESS");
734725
let output = translator.to_cyrillic(&input);
735726
println!("\"{}\" => \"{}\"", input, output);
736-
assert_eq!(output, "ЛЭСС");
727+
assert_eq!(output, "ЛЕСС");
737728
//Special cases: last character is 't'
738729
let input: String = String::from("cat");
739730
let output = translator.to_cyrillic(&input);

0 commit comments

Comments
 (0)