TenshiTranslator.Glossary.CSVGlossary module

class TenshiTranslator.Glossary.CSVGlossary.CSVGlossary(processPath: str)

Bases: Glossary

Glossary with inputs from CSV files

The glossary is loaded from a CSV file Processing is done using regex. The CSV file must be in the format <input>,<output>, with each entry separated by a new line.

Parameters:

processPath – path to the .csv file containing processing replacements

Raises:

FileNotFoundError if any file is not found

process(line: str) str

Apply corrections to a line using regex

Parameters:

line – line to be modified

Returns:

line corrected according to the loaded csv file