TextProcessor

interface TextProcessor

文本处理器接口 实现此接口可对软件中各类文本数据进行统一转换处理(如繁简转换) 注册后软件会在数据流经过时自动调用对应方法

Since

Api 2

Properties

Link copied to clipboard
abstract val enabled: Boolean

此处理器是否启用 为false时软件将跳过该处理器的所有处理逻辑

Functions

Link copied to clipboard
open fun List<String>.process(): List<String>

对字符串列表中的每个元素进行文本处理

open fun <T> Map<T, String>.process(): Map<T, String>

对Map中所有String类型的值进行文本处理

Link copied to clipboard

对书本详情中的文本字段进行处理 会处理标题、副标题、作者、简介、出版社字段

Link copied to clipboard

对书本卷目录中的文本字段进行处理 会处理卷标题及各章节标题字段

Link copied to clipboard
open fun processChapterContent(bookId: String, chapterContent: ChapterContent, componentProcessor: ComponentProcessor): ChapterContent

对章节内容中的文本组件进行处理

Link copied to clipboard

对探索页书本简要信息中的文本字段进行处理 会处理标题和作者字段

Link copied to clipboard
abstract fun processText(text: String): String

对单个字符串进行文本转换处理