更新默认Txt目录规则 Txt目录正则页面增加标题示例 新增部分翻译

pull/2130/head
fisher 2 years ago
parent aea19ae6fe
commit 887b877153
  1. 1680
      app/schemas/io.legado.app.data.AppDatabase/52.json
  2. 72
      app/src/main/assets/defaultData/txtTocRule.json
  3. 5
      app/src/main/java/io/legado/app/data/AppDatabase.kt
  4. 2
      app/src/main/java/io/legado/app/data/DatabaseMigrations.kt
  5. 4
      app/src/main/res/values-es-rES/strings.xml
  6. 2
      app/src/main/res/values-ja-rJP/strings.xml
  7. 4
      app/src/main/res/values-pt-rBR/strings.xml

File diff suppressed because it is too large Load Diff

@ -3,21 +3,24 @@
"id": -1, "id": -1,
"enable": true, "enable": true,
"name": "目录(去空白)", "name": "目录(去空白)",
"rule": "(?<=[ \\s])(?:序章|序言|卷首语|扉页|楔子|正文(?!完|结)|终章|后记|尾声|番外|第?\\s{0,4}[\\d〇零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]+?\\s{0,4}(?:章|节(?!课)|卷|集(?![合和])|部(?![分赛游])|篇(?!张))).{0,30}$", "rule": "(?<=[ \\s])(?:序章|楔子|正文(?!完|结)|终章|后记|尾声|番外|第?\\s{0,4}[\\d〇零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]+?\\s{0,4}(?:章|节(?!课)|卷|集(?![合和]))).{0,30}$",
"example":"第一章 假装第一章前面有空白但我不要",
"serialNumber": 0 "serialNumber": 0
}, },
{ {
"id": -2, "id": -2,
"enable": true, "enable": true,
"name": "目录", "name": "目录",
"rule": "^[  \\t]{0,4}(?:序章|序言|卷首语|扉页|楔子|正文(?!完|结)|终章|后记|尾声|番外|第?\\s{0,4}[\\d〇零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]+?\\s{0,4}(?:章|节(?!课)|卷|集(?![合和])|部(?![分赛游])|篇(?!张))).{0,30}$", "rule": "^[  \\t]{0,4}(?:序章|楔子|正文(?!完|结)|终章|后记|尾声|番外|第?\\s{0,4}[\\d〇零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]+?\\s{0,4}(?:章|节(?!课)|卷|集(?![合和])|部(?![分赛游])|篇(?!张))).{0,30}$",
"example":"第一章 标准的粤语就是这样",
"serialNumber": 1 "serialNumber": 1
}, },
{ {
"id": -3, "id": -3,
"enable": false, "enable": false,
"name": "目录(匹配简介)", "name": "目录(匹配简介)",
"rule": "(?<=[ \\s])(?:(?:内容|文章)?简介|文案|前言|序章|序言|卷首语|扉页|楔子|正文(?!完|结)|终章|后记|尾声|番外|第?\\s{0,4}[\\d〇零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]+?\\s{0,4}(?:章|节(?!课)|卷|集(?![合和])|部(?![分赛游])|回(?![合来事去])|场(?![和合比电是])|篇(?!张))).{0,30}$", "rule": "(?<=[ \\s])(?:(?:内容|文章)?简介|文案|前言|序章|楔子|正文(?!完|结)|终章|后记|尾声|番外|第?\\s{0,4}[\\d〇零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]+?\\s{0,4}(?:章|节(?!课)|卷|集(?![合和])|部(?![分赛游])|回(?![合来事去])|场(?![和合比电是])|篇(?!张))).{0,30}$",
"example": "简介 老夫诸葛村夫",
"serialNumber": 2 "serialNumber": 2
}, },
{ {
@ -25,6 +28,7 @@
"enable": false, "enable": false,
"name": "目录(古典、轻小说备用)", "name": "目录(古典、轻小说备用)",
"rule": "^[  \\t]{0,4}(?:序章|楔子|正文(?!完|结)|终章|后记|尾声|番外|第?\\s{0,4}[\\d〇零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]+?\\s{0,4}(?:章|节(?!课)|卷|集(?![合和])|部(?![分赛游])|回(?![合来事去])|场(?![和合比电是])|话|篇(?!张))).{0,30}$", "rule": "^[  \\t]{0,4}(?:序章|楔子|正文(?!完|结)|终章|后记|尾声|番外|第?\\s{0,4}[\\d〇零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]+?\\s{0,4}(?:章|节(?!课)|卷|集(?![合和])|部(?![分赛游])|回(?![合来事去])|场(?![和合比电是])|话|篇(?!张))).{0,30}$",
"example": "第一章 比上面只多了回和话",
"serialNumber": 3 "serialNumber": 3
}, },
{ {
@ -32,97 +36,127 @@
"enable": false, "enable": false,
"name": "数字(纯数字标题)", "name": "数字(纯数字标题)",
"rule": "(?<=[ \\s])\\d+\\.?[  \\t]{0,4}$", "rule": "(?<=[ \\s])\\d+\\.?[  \\t]{0,4}$",
"example": "12",
"serialNumber": 4 "serialNumber": 4
}, },
{ {
"id": -6, "id": -6,
"enable": false,
"name": "大写数字(纯数字标题)",
"rule": "(?<=[ \\s])[〇零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]{1,12}[  \\t]{0,4}$",
"example": "一百七十",
"serialNumber": 4
},
{
"id": -7,
"enable": true, "enable": true,
"name": "数字 分隔符 标题名称", "name": "数字 分隔符 标题名称",
"rule": "^[  \\t]{0,4}\\d{1,5}[::,., 、_—\\-].{1,30}$", "rule": "^[  \\t]{0,4}\\d{1,5}[::,., 、_—\\-].{1,30}$",
"example": "1、这个就是标题",
"serialNumber": 5 "serialNumber": 5
}, },
{ {
"id": -7, "id": -8,
"enable": true, "enable": true,
"name": "大写数字 分隔符 标题名称", "name": "大写数字 分隔符 标题名称",
"rule": "^[  \\t]{0,4}(?:序章|序言|卷首语|扉页|楔子|正文(?!完|结)|终章|后记|尾声|番外|[〇零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]{1,8})[ 、_—\\-].{1,30}$", "rule": "^[  \\t]{0,4}(?:序章|楔子|正文(?!完|结)|终章|后记|尾声|番外|[〇零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]{1,8})[ 、_—\\-].{1,30}$",
"example": "一、只有前面的数字有差别",
"serialNumber": 6 "serialNumber": 6
}, },
{ {
"id": -8, "id": -9,
"enable": true, "enable": true,
"name": "正文 标题/序号", "name": "正文 标题/序号",
"rule": "^[  \\t]{0,4}正文[  ]{1,4}.{0,20}$", "rule": "^[  \\t]{0,4}正文[  ]{1,4}.{0,20}$",
"example": "正文 我奶常山赵子龙",
"serialNumber": 7 "serialNumber": 7
}, },
{ {
"id": -9, "id": -10,
"enable": true, "enable": true,
"name": "Chapter/Section/Part/Episode 序号 标题", "name": "Chapter/Section/Part/Episode 序号 标题",
"rule": "^[  \\t]{0,4}(?:[Cc]hapter|[Ss]ection|[Pp]art|PART|[Nn][oO]\\.|[Ee]pisode|(?:内容|文章)?简介|文案|前言|序章|楔子|正文(?!完|结)|终章|后记|尾声|番外)\\s{0,4}\\d{1,4}.{0,30}$", "rule": "^[  \\t]{0,4}(?:[Cc]hapter|[Ss]ection|[Pp]art|PART|[Nn][oO]\\.|[Ee]pisode|(?:内容|文章)?简介|文案|前言|序章|楔子|正文(?!完|结)|终章|后记|尾声|番外)\\s{0,4}\\d{1,4}.{0,30}$",
"example": "Chapter 1 MyGrandmaIsNB",
"serialNumber": 8 "serialNumber": 8
}, },
{ {
"id": -10, "id": -11,
"enable": false, "enable": false,
"name": "Chapter(去简介)", "name": "Chapter(去简介)",
"rule": "^[  \\t]{0,4}(?:[Cc]hapter|[Ss]ection|[Pp]art|PART|[Nn][Oo]\\.|[Ee]pisode)\\s{0,4}\\d{1,4}.{0,30}$", "rule": "^[  \\t]{0,4}(?:[Cc]hapter|[Ss]ection|[Pp]art|PART|[Nn][Oo]\\.|[Ee]pisode)\\s{0,4}\\d{1,4}.{0,30}$",
"example": "Chapter 1 MyGrandmaIsNB",
"serialNumber": 9 "serialNumber": 9
}, },
{ {
"id": -11, "id": -12,
"enable": true, "enable": true,
"name": "特殊符号 序号 标题", "name": "特殊符号 序号 标题",
"rule": "(?<=[\\s ])[【〔〖「『〈[\\[](?:第|[Cc]hapter)[\\d〇零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]{1,10}[章节].{0,20}$", "rule": "(?<=[\\s ])[【〔〖「『〈[\\[](?:第|[Cc]hapter)[\\d〇零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]{1,10}[章节].{0,20}$",
"example": "【第一章 后面的符号可以没有",
"serialNumber": 10 "serialNumber": 10
}, },
{ {
"id": -12, "id": -13,
"enable": false, "enable": false,
"name": "特殊符号 标题(成对)", "name": "特殊符号 标题(成对)",
"rule": "(?<=[\\s ]{0,4})(?:[\\[〈「『〖〔《(【\\(].{1,30}[\\)】)》〕〗』」〉\\]]?|(?:内容|文章)?简介|文案|前言|序章|楔子|正文(?!完|结)|终章|后记|尾声|番外)[  ]{0,4}$", "rule": "(?<=[\\s ]{0,4})(?:[\\[〈「『〖〔《(【\\(].{1,30}[\\)】)》〕〗』」〉\\]]?|(?:内容|文章)?简介|文案|前言|序章|楔子|正文(?!完|结)|终章|后记|尾声|番外)[  ]{0,4}$",
"example": "『加个直角引号更专业』",
"serialNumber": 11 "serialNumber": 11
}, },
{ {
"id": -13, "id": -14,
"enable":true, "enable":true,
"name": "特殊符号 标题(单个)", "name": "特殊符号 标题(单个)",
"rule": "(?<=[\\s ]{0,4})(?:[☆★✦✧].{1,30}|(?:内容|文章)?简介|文案|前言|序章|楔子|正文(?!完|结)|终章|后记|尾声|番外)[  ]{0,4}$", "rule": "(?<=[\\s ]{0,4})(?:[☆★✦✧].{1,30}|(?:内容|文章)?简介|文案|前言|序章|楔子|正文(?!完|结)|终章|后记|尾声|番外)[  ]{0,4}$",
"example": "☆、晋江作者最喜欢的格式",
"serialNumber": 12 "serialNumber": 12
}, },
{ {
"id": -14, "id": -15,
"enable": true, "enable": true,
"name": "章/卷 序号 标题", "name": "章/卷 序号 标题",
"rule": "^[ \\t ]{0,4}(?:(?:内容|文章)?简介|文案|前言|序章|序言|卷首语|扉页|楔子|正文(?!完|结)|终章|后记|尾声|番外|[卷章][\\d〇零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]{1,8})[  ]{0,4}.{0,30}$", "rule": "^[ \\t ]{0,4}(?:(?:内容|文章)?简介|文案|前言|序章|楔子|正文(?!完|结)|终章|后记|尾声|番外|[卷章][\\d〇零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]{1,8})[  ]{0,4}.{0,30}$",
"example": "卷五 开源盛世",
"serialNumber": 13 "serialNumber": 13
}, },
{ {
"id": -15, "id": -16,
"enable":false, "enable":false,
"name": "顶格标题", "name": "顶格标题",
"rule": "^\\S.{1,20}$", "rule": "^\\S.{1,20}$",
"example": "不超过20个字顶格写的都是标题",
"serialNumber": 14 "serialNumber": 14
}, },
{ {
"id": -16, "id": -17,
"enable":false, "enable":false,
"name": "双标题(前向)", "name": "双标题(前向)",
"rule": "(?m)(?<=[ \\t ]{0,4})第[\\d〇零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]{1,8}章.{0,30}$(?=[\\s ]{0,8}第[\\d零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]{1,8}章)", "rule": "(?m)(?<=[ \\t ]{0,4})第[\\d〇零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]{1,8}章.{0,30}$(?=[\\s ]{0,8}第[\\d零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]{1,8}章)",
"example": "第一章 真正的标题并假装换行第一章 这个不要",
"serialNumber": 15 "serialNumber": 15
}, },
{ {
"id": -17, "id": -18,
"enable":false, "enable":false,
"name": "双标题(后向)", "name": "双标题(后向)",
"rule": "(?m)(?<=[ \\t ]{0,4}第[\\d〇零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]{1,8}章.{0,30}$[\\s ]{0,8})第[\\d零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]{1,8}章.{0,30}$", "rule": "(?m)(?<=[ \\t ]{0,4}第[\\d〇零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]{1,8}章.{0,30}$[\\s ]{0,8})第[\\d零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]{1,8}章.{0,30}$",
"example": "第一章 这个标题不要并假装换行第一章真正的标题",
"serialNumber": 16 "serialNumber": 16
}, },
{ {
"id":-18, "id":-19,
"enable": true, "enable": true,
"name": "标题 特殊符号 序号", "name": "书名 括号 序号",
"rule": "^.{1,20}[((][\\d〇零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]{1,8}[))][  \t]{0,4}$", "rule": "^.{1,20}[((][\\d〇零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]{1,8}[))][  \t]{0,4}$",
"example": "标题后面数字有括号(12)",
"serialNumber": 17 "serialNumber": 17
},
{
"id":-20,
"enable": true,
"name": "书名 序号",
"rule": "^.{1,20}[\\d〇零一二两三四五六七八九十百千万壹贰叁肆伍陆柒捌玖拾佰仟]{1,8}[  \t]{0,4}$",
"example": "标题后面数字没有括号124",
"serialNumber": 18
} }
] ]

@ -20,7 +20,7 @@ val appDb by lazy {
} }
@Database( @Database(
version = 51, version = 52,
exportSchema = true, exportSchema = true,
entities = [Book::class, BookGroup::class, BookSource::class, BookChapter::class, entities = [Book::class, BookGroup::class, BookSource::class, BookChapter::class,
ReplaceRule::class, SearchBook::class, SearchKeyword::class, Cookie::class, ReplaceRule::class, SearchBook::class, SearchKeyword::class, Cookie::class,
@ -35,7 +35,8 @@ val appDb by lazy {
AutoMigration(from = 47, to = 48), AutoMigration(from = 47, to = 48),
AutoMigration(from = 48, to = 49), AutoMigration(from = 48, to = 49),
AutoMigration(from = 49, to = 50), AutoMigration(from = 49, to = 50),
AutoMigration(from = 50, to = 51) AutoMigration(from = 50, to = 51),
AutoMigration(from = 51, to = 52)
] ]
) )
abstract class AppDatabase : RoomDatabase() { abstract class AppDatabase : RoomDatabase() {

@ -48,7 +48,7 @@ object DatabaseMigrations {
database.execSQL("DROP TABLE txtTocRules") database.execSQL("DROP TABLE txtTocRules")
database.execSQL( database.execSQL(
"""CREATE TABLE txtTocRules(id INTEGER NOT NULL, """CREATE TABLE txtTocRules(id INTEGER NOT NULL,
name TEXT NOT NULL, rule TEXT NOT NULL,example TEXT DEFAULT NULL, serialNumber INTEGER NOT NULL, name TEXT NOT NULL, rule TEXT NOT NULL, serialNumber INTEGER NOT NULL,
enable INTEGER NOT NULL, PRIMARY KEY (id))""" enable INTEGER NOT NULL, PRIMARY KEY (id))"""
) )
} }

@ -333,7 +333,7 @@
<string name="tip_margin_change">Ajuste de margen</string> <string name="tip_margin_change">Ajuste de margen</string>
<string name="allow_update">Activar actualizaciones</string> <string name="allow_update">Activar actualizaciones</string>
<string name="disable_update">Desactivar actualizaciones</string> <string name="disable_update">Desactivar actualizaciones</string>
<string name="split_long_chapter">拆分超长章节</string> <string name="split_long_chapter">Dividir secciones largas</string>
<string name="need_more_time_load_content">正文长度过长时,加载正文可能会花费更多时间</string> <string name="need_more_time_load_content">正文长度过长时,加载正文可能会花费更多时间</string>
<string name="revert_selection">Invertir</string> <string name="revert_selection">Invertir</string>
<string name="search_book_key">Buscar libro por nombre o autor</string> <string name="search_book_key">Buscar libro por nombre o autor</string>
@ -970,7 +970,7 @@
<string name="sys_tts_config">系统tts设置</string> <string name="sys_tts_config">系统tts设置</string>
<string name="sys_tts_config_summary">打开系统tts设置界面</string> <string name="sys_tts_config_summary">打开系统tts设置界面</string>
<string name="cannot_timed_non_playback">非播放状态无法定时</string> <string name="cannot_timed_non_playback">非播放状态无法定时</string>
<string name="all_bookmark">所有书签</string> <string name="all_bookmark">Todos los marcadores</string>
<string name="change_source_batch">批量换源</string> <string name="change_source_batch">批量换源</string>
<string name="book_type_different">书籍类型不一样</string> <string name="book_type_different">书籍类型不一样</string>
<string name="soure_change_source">是否确认换源</string> <string name="soure_change_source">是否确认换源</string>

@ -973,7 +973,7 @@
<string name="sys_tts_config">系统tts设置</string> <string name="sys_tts_config">系统tts设置</string>
<string name="sys_tts_config_summary">打开系统tts设置界面</string> <string name="sys_tts_config_summary">打开系统tts设置界面</string>
<string name="cannot_timed_non_playback">非播放状态无法定时</string> <string name="cannot_timed_non_playback">非播放状态无法定时</string>
<string name="all_bookmark">所有书签</string> <string name="all_bookmark">すべてのブックマーク</string>
<string name="change_source_batch">批量换源</string> <string name="change_source_batch">批量换源</string>
<string name="book_type_different">书籍类型不一样</string> <string name="book_type_different">书籍类型不一样</string>
<string name="soure_change_source">是否确认换源</string> <string name="soure_change_source">是否确认换源</string>

@ -924,7 +924,7 @@
<string name="select_book_folder">选择保存书籍的文件夹</string> <string name="select_book_folder">选择保存书籍的文件夹</string>
<string name="user_agent">用户代理</string> <string name="user_agent">用户代理</string>
<string name="bg_alpha">背景透明度</string> <string name="bg_alpha">背景透明度</string>
<string name="split_long_chapter">拆分超长章节</string> <string name="split_long_chapter">Dividir capítulos longos</string>
<string name="need_more_time_load_content">正文长度过长时,加载正文可能会花费更多时间</string> <string name="need_more_time_load_content">正文长度过长时,加载正文可能会花费更多时间</string>
<!-- check source config string --> <!-- check source config string -->
@ -973,7 +973,7 @@
<string name="sys_tts_config">系统tts设置</string> <string name="sys_tts_config">系统tts设置</string>
<string name="sys_tts_config_summary">打开系统tts设置界面</string> <string name="sys_tts_config_summary">打开系统tts设置界面</string>
<string name="cannot_timed_non_playback">非播放状态无法定时</string> <string name="cannot_timed_non_playback">非播放状态无法定时</string>
<string name="all_bookmark">所有书签</string> <string name="all_bookmark">Todos os marcadores</string>
<string name="change_source_batch">批量换源</string> <string name="change_source_batch">批量换源</string>
<string name="book_type_different">书籍类型不一样</string> <string name="book_type_different">书籍类型不一样</string>
<string name="soure_change_source">是否确认换源</string> <string name="soure_change_source">是否确认换源</string>

Loading…
Cancel
Save