scripts.py.func package¶
Subpackages¶
- scripts.py.func.checks package
- Submodules
- scripts.py.func.checks.check_example_file_is_synced module
- scripts.py.func.checks.integrity_checker module
- scripts.py.func.checks.integrity_rules module
- scripts.py.func.checks.self_tester module
- scripts.py.func.checks.setup_validator module
- scripts.py.func.checks.validate_punctuation_map_keys module
- Module contents
Submodules¶
scripts.py.func.check_memory_critical module¶
scripts.py.func.cleanup module¶
- scripts.py.func.cleanup.cleanup(logger, files_to_remove)¶
scripts.py.func.correct_text module¶
scripts.py.func.create_required_folders module¶
- scripts.py.func.create_required_folders.setup_project_structure(project_root_str: str)¶
Creates all necessary directories and placeholder files within the project, using the provided project root path. This script is the single source of truth for the project’s internal directory structure.
scripts.py.func.guess_lt_language_from_model module¶
- scripts.py.func.guess_lt_language_from_model.guess_lt_language_from_model(logger, model_name)¶
Guesses the LanguageTool language code from a Vosk model name.
scripts.py.func.handle_trigger module¶
scripts.py.func.main module¶
scripts.py.func.model_manager module¶
scripts.py.func.normalize_punctuation module¶
- scripts.py.func.normalize_punctuation.normalize_punctuation(text: str, punctuation_map: dict) Tuple[str, bool]¶
Replaces text based on a map, returning the new text and a flag.
- Args:
text: The input string. punctuation_map: A dictionary of phrases to replace.
- Returns:
A tuple: (processed_text: str, was_exact_match: bool). The boolean is True only if the entire input text was an exact key in the map, signaling that no further processing should occur.
scripts.py.func.notify module¶
- scripts.py.func.notify.notify(summary: str, body: str = '', urgency: str = 'low', icon: str = None, duration: int = 3000, replace_tag: str = None) None¶
Sends a desktop notification, adapting to the host operating system.
scripts.py.func.prioritize_model module¶
- scripts.py.func.prioritize_model.prioritize_model(logger, loaded_models: dict, key_to_prioritize: str)¶
Moves a model to the front of the ‘loaded_models’ dictionary to ensure it’s the last to be unloaded in low-memory situations.
The dictionary is modified in-place.
scripts.py.func.process_text_in_background module¶
scripts.py.func.start_languagetool_server module¶
- scripts.py.func.start_languagetool_server.start_languagetool_server(logger, languagetool_jar_path, base_url)¶
scripts.py.func.stop_languagetool_server module¶
- scripts.py.func.stop_languagetool_server.stop_languagetool_server(logger, languagetool_process)¶