Skip to content

Commit

Permalink
principle part generation for getList latin
Browse files Browse the repository at this point in the history
  • Loading branch information
cqb13 committed Mar 1, 2024
1 parent 665c934 commit 3edc05a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/use_data/parsers/latin_dictionary_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub fn parse_latin_dictionary(
let mut rng = rand::thread_rng();
while latin_word_info_list.len() as i32 != amount {
let random_index = rng.gen_range(0..dictionary.len());
let word_at_index = dictionary[random_index].clone();
let mut word_at_index = dictionary[random_index].clone();
if !word_fits_filters(
&word_at_index.orth,
&word_at_index.pos,
Expand All @@ -31,14 +31,15 @@ pub fn parse_latin_dictionary(
) {
continue;
}
word_at_index.generate_principle_parts();
latin_word_info_list.push(word_at_index);
}
} else {
for word in dictionary {
for mut word in dictionary {
if !word_fits_filters(&word.orth, &word.pos, &pos_list, &max, &min, &exact) {
continue;
}

word.generate_principle_parts();
latin_word_info_list.push(word);
if latin_word_info_list.len() as i32 == amount {
break;
Expand Down

0 comments on commit 3edc05a

Please sign in to comment.