tommy.controller.synonyms_controller

Classes

class tommy.controller.synonyms_controller.SynonymsController[source]

Bases: object

A class that handles all synonym related functionality.

__init__() None[source]

Initializes the synonyms controller.

on_model_swap()[source]

Notify the frontend that the synonyms model has changed.

set_model_refs(synonyms_model: SynonymsModel)[source]

Sets the reference to the synonyms model.

property synonyms_model: SynonymsModel
property synonyms_model_changed_event: EventHandler[dict[str, str]]

This event gets triggered when the synonyms model is changed due to the user switching config

update_synonyms(synonyms: dict[str, str]) None[source]

Update the synonyms model with a new dictionary of synonyms.

Parameters:

synonyms – A dictionary where the keys represent source words

and the values represent target words. :return: None