Skip to content

Commit

Permalink
fixed double_consonants subtract with overflowf
Browse files Browse the repository at this point in the history
  • Loading branch information
cqb13 committed Jun 18, 2024
1 parent c469a9e commit 3b85f9d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
1 change: 1 addition & 0 deletions fix.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Iam per multos annos ita vixerat et semper idem fecerat
25 changes: 18 additions & 7 deletions src/translators/latin_to_english/tricks/word_mods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,24 @@ pub fn double_consonants(latin_word: &str) -> (String, String) {
doubled_word.push(*letter);
continue;
}
if i == 0 && is_vowel(split_word[i + 1]) {
doubled_word.push(*letter);
continue;
} else if i == split_word.len() - 1 && is_vowel(split_word[i - 1]) {
doubled_word.push(*letter);
doubled_word.push(*letter);
continue;
if i == 0 {
if is_vowel(split_word[i + 1]) {
doubled_word.push(*letter);
doubled_word.push(*letter);
continue;
} else {
doubled_word.push(*letter);
continue;
}
} else if i == split_word.len() - 1 {
if is_vowel(split_word[i - 1]) {
doubled_word.push(*letter);
doubled_word.push(*letter);
continue;
} else {
doubled_word.push(*letter);
continue;
}
} else if is_vowel(split_word[i - 1]) && is_vowel(split_word[i + 1]) {
doubled_word.push(*letter);
doubled_word.push(*letter);
Expand Down

0 comments on commit 3b85f9d

Please # to comment.