tommy.controller.stopwords_controller

Classes

class tommy.controller.stopwords_controller.StopwordsController[source]

Bases: object

A class that handles all stopword related functionality.

__init__() None[source]

Initializes the stopwords controller, and load the stopwords of the selected language

static get_stopwords_path(language: SupportedLanguage) str[source]

Return the path to the stopwords file for the selected language

load_default_stopwords(language: SupportedLanguage) None[source]

Load the default stopwords of the selected language

on_model_swap()[source]

Notify the frontend that the stopwords model has changed.

set_controller_refs(language_controller: LanguageController)[source]

Sets the reference to the language controller.

set_model_refs(stopwords_model: StopwordsModel)[source]

Sets the reference to the stopwords model.

property stopwords_model: StopwordsModel
property stopwords_model_changed_event: EventHandler[list[str]]

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

update_stopwords(words: list[str]) None[source]

Update the stopwords model with a new list of extra stopwords.

Parameters:

words – The new list of stopwords

Returns:

None