speechmarkdown.formatters.text#
Classes#
Formatter for outputting plain text instead of SSML elements. |
Module Contents#
- class speechmarkdown.formatters.text.TextFormatter(options: speechmarkdown.options.SpeechOptions)[source]#
Bases:
speechmarkdown.formatters.base.FormatterBaseFormatter for outputting plain text instead of SSML elements.
- format(ast: speechmarkdown.parser.ASTNode | List[speechmarkdown.parser.ASTNode]) str[source]#
Format the AST to basic plain text strings without SSML tags.
- formatFromAst(ast: speechmarkdown.parser.ASTNode, lines: List[str] | None = None) List[str][source]#
Process single nodes handling text appending correctly.
- Parameters:
ast (ASTNode) – Focus AST element to render text.
lines (Optional[List[str]]) – The collector line list.
- Returns:
Refreshed output chunks.
- Return type:
List[str]
- extractParenthesizedText(node: speechmarkdown.parser.ASTNode) str[source]#