|
|
@ -20,7 +20,9 @@ class AnalyzeTxtFile { |
|
|
|
@Throws(Exception::class) |
|
|
|
@Throws(Exception::class) |
|
|
|
fun analyze(book: Book): ArrayList<BookChapter> { |
|
|
|
fun analyze(book: Book): ArrayList<BookChapter> { |
|
|
|
val bookFile = getBookFile(book) |
|
|
|
val bookFile = getBookFile(book) |
|
|
|
book.charset = EncodingDetect.getEncode(bookFile) |
|
|
|
if (book.charset == null) { |
|
|
|
|
|
|
|
book.charset = EncodingDetect.getEncode(bookFile) |
|
|
|
|
|
|
|
} |
|
|
|
charset = book.fileCharset() |
|
|
|
charset = book.fileCharset() |
|
|
|
val rulePattern = if (book.tocUrl.isNotEmpty()) { |
|
|
|
val rulePattern = if (book.tocUrl.isNotEmpty()) { |
|
|
|
Pattern.compile(book.tocUrl, Pattern.MULTILINE) |
|
|
|
Pattern.compile(book.tocUrl, Pattern.MULTILINE) |
|
|
|