2026-04-13 22:25:58 +03:00
|
|
|
use crate::data_provider::card_sets::{delete_set, update_card_set};
|
2026-05-25 12:23:32 +03:00
|
|
|
use crate::data_provider::card_stats::load_stats_of_set;
|
2026-08-01 17:16:58 +03:00
|
|
|
use crate::history::HistoryState;
|
2026-05-25 12:23:32 +03:00
|
|
|
use crate::lang::{SetOrderMode, WordData};
|
2026-08-01 17:16:58 +03:00
|
|
|
use crate::navigation::Page::{History, PreviousPage, Repetition};
|
|
|
|
|
use crate::navigation::{NavigatedPage, Page};
|
2026-04-13 22:25:58 +03:00
|
|
|
use crate::repetition::RepetitionState;
|
2026-08-01 17:16:58 +03:00
|
|
|
use crate::styling::*;
|
2026-08-01 13:04:18 +03:00
|
|
|
use crate::{AppState, RootMessage};
|
|
|
|
|
use iced::widget::button::{danger, Status};
|
2026-04-13 22:25:58 +03:00
|
|
|
pub use iced::widget::button::{Catalog, Style};
|
2026-05-25 12:23:32 +03:00
|
|
|
use iced::widget::container::bordered_box;
|
2026-08-01 01:22:26 +03:00
|
|
|
use iced::widget::{button, column, container, radio, row, scrollable, space, text, text_input, Column};
|
2026-08-01 19:36:43 +03:00
|
|
|
use iced::{Background, Border, Center, Color, Element, Fill, Length, Shadow, Task, Theme};
|
2026-04-09 22:45:31 +03:00
|
|
|
use rhai::{Engine, Scope};
|
|
|
|
|
use std::sync::{Arc, Mutex};
|
|
|
|
|
|
|
|
|
|
#[derive(Clone)]
|
|
|
|
|
pub struct RepetitionsState {
|
|
|
|
|
selected_set: Option<usize>,
|
|
|
|
|
correct_filters: Vec<bool>,
|
2026-05-25 12:23:32 +03:00
|
|
|
|
2026-04-09 22:45:31 +03:00
|
|
|
pub state: Arc<Mutex<AppState>>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl NavigatedPage<RepetitionsMessage> for RepetitionsState {
|
|
|
|
|
fn navigate(&self, message: &RepetitionsMessage) -> Option<Page> {
|
|
|
|
|
if let RepetitionsMessage::Back = message {
|
|
|
|
|
Some(PreviousPage)
|
2026-07-05 01:58:32 +03:00
|
|
|
} else if let RepetitionsMessage::GoToHistory = message {
|
2026-07-29 12:57:46 +03:00
|
|
|
let card_set;
|
|
|
|
|
{
|
|
|
|
|
card_set = self.state.lock().unwrap().card_sets[self.selected_set.unwrap()].id;
|
|
|
|
|
}
|
|
|
|
|
Some(History(HistoryState::new(card_set, self.state.clone())))
|
2026-05-25 12:23:32 +03:00
|
|
|
} else if let RepetitionsMessage::GoToRepetition = message {
|
2026-04-13 22:25:58 +03:00
|
|
|
let clone = self.state.clone();
|
2026-04-14 15:19:46 +03:00
|
|
|
let card_set;
|
|
|
|
|
{
|
|
|
|
|
card_set = self.state.lock().unwrap().card_sets[self.selected_set.unwrap()].clone();
|
|
|
|
|
}
|
2026-05-25 12:23:32 +03:00
|
|
|
Some(Repetition(RepetitionState::new(card_set, clone)))
|
2026-04-09 22:45:31 +03:00
|
|
|
} else {
|
|
|
|
|
None
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl RepetitionsState {
|
|
|
|
|
pub(crate) fn new(state: Arc<Mutex<AppState>>) -> RepetitionsState {
|
2026-04-13 22:25:58 +03:00
|
|
|
let count = state.lock().unwrap().card_sets.len();
|
2026-04-09 22:45:31 +03:00
|
|
|
RepetitionsState {
|
|
|
|
|
selected_set: None,
|
2026-04-13 22:25:58 +03:00
|
|
|
correct_filters: vec![true; count],
|
2026-04-09 22:45:31 +03:00
|
|
|
state,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl RepetitionsState {
|
|
|
|
|
pub fn update(&mut self, message: RepetitionsMessage) -> Task<RootMessage> {
|
2026-04-13 22:25:58 +03:00
|
|
|
let mut state = self.state.lock().unwrap();
|
2026-04-09 22:45:31 +03:00
|
|
|
match message {
|
|
|
|
|
RepetitionsMessage::Next => {}
|
|
|
|
|
RepetitionsMessage::Back => {}
|
|
|
|
|
RepetitionsMessage::GoToRepetition => {}
|
2026-07-05 01:58:32 +03:00
|
|
|
RepetitionsMessage::GoToHistory => {}
|
2026-04-09 22:45:31 +03:00
|
|
|
RepetitionsMessage::CreateSet => {
|
2026-04-13 22:25:58 +03:00
|
|
|
let index = state.card_sets.len() + 1;
|
|
|
|
|
state
|
|
|
|
|
.card_sets
|
|
|
|
|
.push(CardSetSettings::with_name(format!("Card set #{}", index)));
|
2026-04-09 22:45:31 +03:00
|
|
|
self.correct_filters.push(true);
|
|
|
|
|
}
|
|
|
|
|
RepetitionsMessage::DeleteSet => {
|
2026-04-13 22:25:58 +03:00
|
|
|
let set = state.card_sets.remove(self.selected_set.unwrap());
|
2026-04-09 22:45:31 +03:00
|
|
|
self.correct_filters.remove(self.selected_set.unwrap());
|
|
|
|
|
self.selected_set = None;
|
2026-04-13 22:25:58 +03:00
|
|
|
delete_set(&set, &state.connection);
|
2026-04-09 22:45:31 +03:00
|
|
|
}
|
|
|
|
|
RepetitionsMessage::SelectSet(index) => {
|
|
|
|
|
self.selected_set = Some(index);
|
2026-05-25 12:23:32 +03:00
|
|
|
let mut set = state.card_sets.get(index).unwrap().clone();
|
|
|
|
|
set.update_worst_words(&state);
|
|
|
|
|
state.card_sets[index] = set;
|
2026-04-09 22:45:31 +03:00
|
|
|
}
|
|
|
|
|
RepetitionsMessage::SetName(new) => {
|
2026-04-13 22:25:58 +03:00
|
|
|
state.card_sets[self.selected_set.unwrap()].name = new;
|
2026-04-09 22:45:31 +03:00
|
|
|
}
|
|
|
|
|
RepetitionsMessage::Save => {
|
2026-04-13 22:25:58 +03:00
|
|
|
for i in 0..state.card_sets.len() {
|
|
|
|
|
self.correct_filters[i] = state.card_sets[i].check_filter();
|
2026-04-09 22:45:31 +03:00
|
|
|
}
|
|
|
|
|
|
2026-04-13 22:25:58 +03:00
|
|
|
let word = &mut state.card_sets[self.selected_set.unwrap()].clone();
|
|
|
|
|
|
|
|
|
|
update_card_set(word, &state.connection);
|
|
|
|
|
|
|
|
|
|
state.card_sets[self.selected_set.unwrap()] = word.clone();
|
2026-04-09 22:45:31 +03:00
|
|
|
}
|
|
|
|
|
RepetitionsMessage::SetForward(new) => {
|
2026-04-13 22:25:58 +03:00
|
|
|
state.card_sets[self.selected_set.unwrap()].forward = new;
|
2026-04-09 22:45:31 +03:00
|
|
|
}
|
|
|
|
|
RepetitionsMessage::SetBackward(new) => {
|
2026-04-13 22:25:58 +03:00
|
|
|
state.card_sets[self.selected_set.unwrap()].backward = new;
|
2026-04-09 22:45:31 +03:00
|
|
|
}
|
|
|
|
|
RepetitionsMessage::SetFilter(new) => {
|
2026-04-13 22:25:58 +03:00
|
|
|
state.card_sets[self.selected_set.unwrap()].filter = new;
|
2026-04-09 22:45:31 +03:00
|
|
|
}
|
|
|
|
|
RepetitionsMessage::TryFilter => {
|
2026-04-13 22:25:58 +03:00
|
|
|
let set = state.card_sets.get(self.selected_set.unwrap()).unwrap();
|
|
|
|
|
let count = set.get_word_list(&state).len();
|
|
|
|
|
state.card_sets[self.selected_set.unwrap()].count = Some(count);
|
2026-05-25 12:23:32 +03:00
|
|
|
},
|
|
|
|
|
RepetitionsMessage::SetOpenMode(mode) => {
|
|
|
|
|
state.card_sets.get_mut(self.selected_set.unwrap()).unwrap().open_mode = mode;
|
2026-04-09 22:45:31 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Task::none()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub fn view(&self) -> Element<'_, RepetitionsMessage> {
|
2026-08-01 19:36:43 +03:00
|
|
|
back_overlay(row![
|
2026-04-09 22:45:31 +03:00
|
|
|
column![
|
|
|
|
|
scrollable(self.sets_list()).height(Fill),
|
2026-08-01 17:16:58 +03:00
|
|
|
button("Добавить").style(jl_button)
|
2026-04-09 22:45:31 +03:00
|
|
|
.width(Fill)
|
|
|
|
|
.on_press(RepetitionsMessage::CreateSet),
|
|
|
|
|
]
|
2026-04-16 09:56:57 +03:00
|
|
|
.spacing(DEFAULT_SPACING)
|
2026-04-09 22:45:31 +03:00
|
|
|
.width(Length::FillPortion(1)),
|
|
|
|
|
self.selected_set_view(),
|
|
|
|
|
self.launch_button()
|
|
|
|
|
]
|
2026-08-01 19:36:43 +03:00
|
|
|
.align_y(Center)
|
|
|
|
|
.spacing(DEFAULT_SPACING)
|
|
|
|
|
.width(Fill)
|
|
|
|
|
.height(Fill).into(), RepetitionsMessage::Back)
|
2026-04-09 22:45:31 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn launch_button(&self) -> Element<'_, RepetitionsMessage> {
|
2026-08-01 13:04:18 +03:00
|
|
|
if let Some(set) = self.selected_set && self.state.lock().unwrap().card_sets[set].id != 0 {
|
2026-08-01 17:16:58 +03:00
|
|
|
return button(text!("▷").height(Fill).center()).style(jl_button)
|
2026-04-09 22:45:31 +03:00
|
|
|
.height(200)
|
|
|
|
|
.on_press(RepetitionsMessage::GoToRepetition)
|
|
|
|
|
.into();
|
|
|
|
|
}
|
|
|
|
|
space().into()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn selected_set_view(&self) -> Element<'_, RepetitionsMessage> {
|
|
|
|
|
if let Some(index) = self.selected_set {
|
2026-05-25 12:23:32 +03:00
|
|
|
let set;
|
|
|
|
|
{
|
|
|
|
|
set = self.state.lock().unwrap().card_sets[index].clone();
|
|
|
|
|
}
|
2026-04-09 22:45:31 +03:00
|
|
|
return column![
|
|
|
|
|
scrollable(
|
|
|
|
|
column![
|
2026-08-01 01:22:26 +03:00
|
|
|
text_input("Название набора", &set.name)
|
2026-04-09 22:45:31 +03:00
|
|
|
.on_input(RepetitionsMessage::SetName),
|
2026-08-01 01:22:26 +03:00
|
|
|
text_input("Передняя сторона", &set.forward)
|
2026-04-09 22:45:31 +03:00
|
|
|
.on_input(RepetitionsMessage::SetForward),
|
2026-08-01 01:22:26 +03:00
|
|
|
text_input("Задняя сторона", &set.backward)
|
2026-04-09 22:45:31 +03:00
|
|
|
.on_input(RepetitionsMessage::SetBackward),
|
|
|
|
|
text!("Фильтр"),
|
2026-08-01 01:22:26 +03:00
|
|
|
text_input("", &set.filter).on_input(RepetitionsMessage::SetFilter),
|
2026-08-01 17:16:58 +03:00
|
|
|
button("Проверить фильтр").style(jl_button).on_press(RepetitionsMessage::TryFilter),
|
2026-05-25 12:23:32 +03:00
|
|
|
self.count_view(&set),
|
|
|
|
|
radio("Обычный режим", SetOrderMode::Default, Some(set.open_mode), RepetitionsMessage::SetOpenMode),
|
2026-07-05 01:58:32 +03:00
|
|
|
self.words_words_view(&set),
|
2026-08-01 17:16:58 +03:00
|
|
|
button("История").style(jl_button).on_press(RepetitionsMessage::GoToHistory),
|
2026-04-09 22:45:31 +03:00
|
|
|
]
|
2026-04-16 09:56:57 +03:00
|
|
|
.spacing(DEFAULT_SPACING)
|
2026-04-09 22:45:31 +03:00
|
|
|
)
|
|
|
|
|
.height(Fill),
|
2026-04-13 22:25:58 +03:00
|
|
|
row![
|
2026-08-01 17:16:58 +03:00
|
|
|
button("Сохранить").style(jl_button).on_press(RepetitionsMessage::Save),
|
2026-04-13 22:25:58 +03:00
|
|
|
button("Удалить")
|
2026-04-17 12:38:05 +03:00
|
|
|
.style(danger)
|
2026-04-13 22:25:58 +03:00
|
|
|
.on_press(RepetitionsMessage::DeleteSet)
|
|
|
|
|
]
|
2026-04-16 09:56:57 +03:00
|
|
|
.spacing(DEFAULT_SPACING),
|
2026-04-09 22:45:31 +03:00
|
|
|
]
|
2026-04-16 09:56:57 +03:00
|
|
|
.spacing(DEFAULT_SPACING)
|
2026-04-13 22:25:58 +03:00
|
|
|
.width(Length::FillPortion(2))
|
|
|
|
|
.into();
|
2026-04-09 22:45:31 +03:00
|
|
|
}
|
|
|
|
|
space().width(Length::FillPortion(2)).into()
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-25 12:23:32 +03:00
|
|
|
fn words_words_view(&self, set: &CardSetSettings) -> Element<'_, RepetitionsMessage> {
|
|
|
|
|
column![
|
|
|
|
|
text!("Худшие слова"),
|
|
|
|
|
container(scrollable(self.worst_words_list(&set)).height(200)).style(bordered_box),
|
2026-07-29 14:24:40 +03:00
|
|
|
radio("Начать с плохих слов", SetOrderMode::TrainWorstFirst, Some(set.open_mode), RepetitionsMessage::SetOpenMode),
|
2026-05-25 12:23:32 +03:00
|
|
|
radio("Полностью случайно", SetOrderMode::FullRandom, Some(set.open_mode), RepetitionsMessage::SetOpenMode)
|
|
|
|
|
]
|
|
|
|
|
.spacing(DEFAULT_SPACING)
|
|
|
|
|
.into()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn worst_words_list(&self, set: &CardSetSettings) -> Element<'_, RepetitionsMessage> {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let mut column = Column::new();
|
|
|
|
|
|
|
|
|
|
for word in set.worst_words_list.clone().unwrap() {
|
2026-08-01 01:22:26 +03:00
|
|
|
column = column.push(text!("{} | {}", &word.key, &word.value));
|
2026-05-25 12:23:32 +03:00
|
|
|
}
|
|
|
|
|
column.into()
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-13 22:25:58 +03:00
|
|
|
fn count_view(&self, set: &CardSetSettings) -> Element<'_, RepetitionsMessage> {
|
|
|
|
|
if let Some(count) = set.count {
|
2026-08-01 19:36:43 +03:00
|
|
|
return text!("Количество слов: {}", count).into();
|
2026-04-09 22:45:31 +03:00
|
|
|
}
|
|
|
|
|
space().into()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn sets_list(&self) -> Column<'_, RepetitionsMessage> {
|
|
|
|
|
let mut column = Column::new();
|
|
|
|
|
let mut i = 0;
|
2026-04-13 22:25:58 +03:00
|
|
|
let sets = &self.state.lock().unwrap().card_sets;
|
|
|
|
|
for set in sets {
|
2026-04-09 22:45:31 +03:00
|
|
|
column = column.push(
|
|
|
|
|
button(text!("{}", set.name.clone()))
|
|
|
|
|
.on_press_with(move || RepetitionsMessage::SelectSet(i.clone()))
|
2026-08-01 13:04:18 +03:00
|
|
|
.style(move |_x: &Theme, status : Status| Style {
|
|
|
|
|
background: if status == Status::Hovered {Some(Background::Color(Color::WHITE.scale_alpha(0.1)))} else { None },
|
2026-04-09 22:45:31 +03:00
|
|
|
text_color: if self.correct_filters[i.clone()] {
|
2026-05-12 16:57:05 +03:00
|
|
|
_x.palette().primary
|
2026-04-09 22:45:31 +03:00
|
|
|
} else {
|
|
|
|
|
_x.palette().warning
|
|
|
|
|
},
|
2026-08-01 13:04:18 +03:00
|
|
|
border: Border{
|
|
|
|
|
color: Default::default(),
|
|
|
|
|
width: 0.0,
|
|
|
|
|
radius: 8.0.into(),
|
|
|
|
|
},
|
2026-04-09 22:45:31 +03:00
|
|
|
shadow: Shadow::default(),
|
|
|
|
|
snap: false,
|
|
|
|
|
}),
|
|
|
|
|
);
|
|
|
|
|
i += 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
column
|
|
|
|
|
}
|
2026-05-25 12:23:32 +03:00
|
|
|
|
2026-04-09 22:45:31 +03:00
|
|
|
}
|
2026-04-14 15:19:46 +03:00
|
|
|
|
2026-05-25 12:23:32 +03:00
|
|
|
#[derive(Clone)]
|
2026-04-09 22:45:31 +03:00
|
|
|
pub enum RepetitionsMessage {
|
|
|
|
|
Next,
|
|
|
|
|
Back,
|
|
|
|
|
GoToRepetition,
|
|
|
|
|
CreateSet,
|
|
|
|
|
DeleteSet,
|
|
|
|
|
SetName(String),
|
|
|
|
|
SelectSet(usize),
|
|
|
|
|
Save,
|
|
|
|
|
SetForward(String),
|
|
|
|
|
SetBackward(String),
|
|
|
|
|
SetFilter(String),
|
|
|
|
|
TryFilter,
|
2026-07-05 01:58:32 +03:00
|
|
|
SetOpenMode(SetOrderMode),
|
|
|
|
|
GoToHistory,
|
2026-04-09 22:45:31 +03:00
|
|
|
}
|
|
|
|
|
|
2026-05-25 12:23:32 +03:00
|
|
|
#[derive(Clone)]
|
2026-04-13 22:25:58 +03:00
|
|
|
pub struct CardSetSettings {
|
|
|
|
|
pub id: u32,
|
|
|
|
|
pub name: String,
|
|
|
|
|
pub forward: String,
|
|
|
|
|
pub backward: String,
|
|
|
|
|
pub filter: String,
|
|
|
|
|
pub count: Option<usize>,
|
2026-05-25 12:23:32 +03:00
|
|
|
pub worst_words_list: Option<Vec<WordData>>,
|
|
|
|
|
pub open_mode: SetOrderMode
|
2026-04-09 22:45:31 +03:00
|
|
|
}
|
|
|
|
|
|
2026-04-13 22:25:58 +03:00
|
|
|
impl CardSetSettings {
|
|
|
|
|
fn with_name(name: String) -> CardSetSettings {
|
|
|
|
|
CardSetSettings {
|
|
|
|
|
id: 0,
|
2026-04-09 22:45:31 +03:00
|
|
|
name,
|
|
|
|
|
forward: "".to_string(),
|
|
|
|
|
backward: "".to_string(),
|
|
|
|
|
filter: "true".to_string(),
|
|
|
|
|
count: None,
|
2026-05-25 12:23:32 +03:00
|
|
|
worst_words_list: None,
|
|
|
|
|
open_mode: SetOrderMode::Default,
|
2026-04-09 22:45:31 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn check_filter(&self) -> bool {
|
|
|
|
|
let engine = Engine::new();
|
|
|
|
|
let ast = engine.compile(&self.filter);
|
|
|
|
|
ast.is_ok()
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-05 12:02:59 +03:00
|
|
|
pub fn get_word_list(&self, state: &AppState) -> Vec<WordData> {
|
2026-04-09 22:45:31 +03:00
|
|
|
let mut list = vec![];
|
|
|
|
|
let engine = Engine::new();
|
|
|
|
|
let ast = engine.compile(&self.filter);
|
|
|
|
|
if ast.is_err() {
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let ast = ast.unwrap();
|
|
|
|
|
|
2026-05-10 22:15:03 +03:00
|
|
|
let groups = &state.word_groups;
|
|
|
|
|
|
2026-04-09 22:45:31 +03:00
|
|
|
for word in &state.dictionary {
|
|
|
|
|
let mut more = rhai::Map::new();
|
|
|
|
|
for iced in &word.additional {
|
|
|
|
|
more.insert(iced.0.clone().into(), iced.1.clone().into());
|
|
|
|
|
}
|
|
|
|
|
let mut scope = Scope::new();
|
2026-04-13 22:25:58 +03:00
|
|
|
scope
|
|
|
|
|
.push_constant("key", word.key.clone())
|
2026-04-09 22:45:31 +03:00
|
|
|
.push_constant("value", word.value.clone())
|
|
|
|
|
.push_constant("tags", word.tags.clone())
|
2026-05-10 22:15:03 +03:00
|
|
|
.push_constant("more", more)
|
2026-05-25 12:23:32 +03:00
|
|
|
.push_constant(
|
|
|
|
|
"group",
|
|
|
|
|
groups
|
|
|
|
|
.iter()
|
|
|
|
|
.find(|g| g.id == word.group_id)
|
|
|
|
|
.cloned()
|
|
|
|
|
.unwrap()
|
|
|
|
|
.name,
|
|
|
|
|
);
|
2026-04-09 22:45:31 +03:00
|
|
|
|
|
|
|
|
let result = engine.eval_ast_with_scope::<bool>(&mut scope, &ast);
|
|
|
|
|
if result.is_ok() && result.unwrap() {
|
|
|
|
|
list.push(word.clone());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
list
|
|
|
|
|
}
|
2026-04-20 15:21:31 +03:00
|
|
|
|
|
|
|
|
pub fn require_speech(&self) -> bool {
|
2026-05-25 12:23:32 +03:00
|
|
|
self.forward == "speech" || self.backward == "speech"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn update_worst_words(&mut self, state: &AppState){
|
|
|
|
|
if let Some(_) = self.worst_words_list {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let connection = &state.connection;
|
|
|
|
|
let mut stats = load_stats_of_set(self, connection);
|
|
|
|
|
stats.sort_by_key(|s| s.calculated_score() as i32);
|
|
|
|
|
let avg = stats.iter().map(|s| s.calculated_score()).sum::<f32>() / stats.len() as f32;
|
|
|
|
|
let avg = avg * 0.7;
|
|
|
|
|
let bad: Vec<WordData> = stats
|
|
|
|
|
.iter()
|
|
|
|
|
.take_while(|word| word.calculated_score() < avg)
|
|
|
|
|
.map(|stat| {
|
|
|
|
|
state.dictionary[ state
|
|
|
|
|
.dictionary
|
|
|
|
|
.binary_search_by_key(&stat.word_id, |x| x.id)
|
|
|
|
|
.unwrap()].clone()
|
|
|
|
|
})
|
|
|
|
|
.collect();
|
|
|
|
|
|
|
|
|
|
self.worst_words_list = Some(bad.clone());
|
2026-04-20 15:21:31 +03:00
|
|
|
}
|
2026-05-25 12:23:32 +03:00
|
|
|
|
|
|
|
|
|
2026-04-09 22:45:31 +03:00
|
|
|
}
|