11package com.novel.read.service.help
22
33import androidx.lifecycle.MutableLiveData
4- import com.hankcs.hanlp.HanLP
54import com.novel.read.App
6- import com.novel.read.constant.AppConst
75import com.novel.read.constant.BookType
86import com.novel.read.data.db.entity.Book
97import com.novel.read.data.db.entity.BookChapter
@@ -16,6 +14,7 @@ import com.novel.read.help.IntentDataHelp
1614import com.novel.read.help.ReadBookConfig
1715import com.novel.read.service.BaseReadAloudService
1816import com.novel.read.help.coroutine.Coroutine
17+ import com.spreada.utils.chinese.ZHConverter
1918import io.legado.app.ui.book.read.page.provider.ChapterProvider
2019import io.legado.app.ui.book.read.page.provider.ImageProvider
2120import kotlinx.coroutines.Dispatchers
@@ -25,7 +24,6 @@ import kotlinx.coroutines.launch
2524import org.jetbrains.anko.getStackTraceString
2625import org.jetbrains.anko.toast
2726
28-
2927object ReadBook {
3028 var titleDate = MutableLiveData <String >()
3129 var book: Book ? = null
@@ -354,8 +352,8 @@ object ReadBook {
354352 Coroutine .async {
355353 if (chapter.chapterIndex in durChapterIndex - 1 .. durChapterIndex + 1 ) {
356354 chapter.chapterName = when (AppConfig .chineseConverterType) {
357- 1 -> HanLP .convertToSimplifiedChinese (chapter.chapterName)
358- 2 -> HanLP .convertToTraditionalChinese (chapter.chapterName)
355+ 1 -> ZHConverter .getInstance( ZHConverter . SIMPLIFIED ).convert (chapter.chapterName)
356+ 2 -> ZHConverter .getInstance( ZHConverter . TRADITIONAL ).convert (chapter.chapterName)
359357 else -> chapter.chapterName
360358 }
361359 val contents = BookHelp .disposeContent(
0 commit comments