-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path異世界迷宮都市治癒魔法師.ts
110 lines (85 loc) · 2.34 KB
/
異世界迷宮都市治癒魔法師.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
import { lazymarks } from '@node-novel/layout-pattern/lib/core/pattern/index';
import { _word_en, _word_en3, _word_jp1, _word_zh_all } from '@node-novel/layout-pattern/lib/core/word';
import { IWords, vMaybe, IWordsAll } from '@node-novel/layout-pattern/lib/core/word';
import { _zh_num2, sp, sp2, _zh_num, _full_num, EN_REGEXP } from '@node-novel/layout-pattern/lib/core/const';
import { IPatternRule } from '@node-novel/layout-pattern/lib/core/types';
import * as StrUtil from 'str-util';
import { _word_zh } from 'regexp-cjk/lib';
import { EnumLazyMarkKeys } from '@node-novel/layout-pattern/lib/core/pattern-keys';
/**
* 改成小說名字 (可留白 則自動設定為檔案名稱)
*/
export const lang = '' as const;
/**
* 在這裡放此小說專屬的取代樣本
*/
export const words_source: IPatternRule["words_source"] = [
//['要取代的字', '取代後的字'],
//_word_jp1('日文原名專用', '日文原名專用'),
//_word_en3('英文專用', '英文專用'),
];
/**
* @private
*/
export const words_layout: IPatternRule["words_layout"] = [
['X療癒', '究極療癒'],
...lazymarks['clear_002'],
...lazymarks['class'],
...lazymarks['class_002'],
//...lazymarks['zh_cht'],
//...lazymarks['unit'],
...lazymarks['ln_0010'],
...lazymarks['4'],
...lazymarks['full_width_001'],
...lazymarks['full_width_002'],
...lazymarks['0'],
...lazymarks['1'],
...lazymarks['2'],
...lazymarks['3'],
...lazymarks['5'],
/**
* 無差別將 【】 轉為對話符號
* 如果可以盡量不要使用此規則
*/
//...lazymarks['7'],
/**
* 將可能是對話的 【】 轉為對話符號
* 如果可以盡量不要使用此規則
*/
//...lazymarks['8'],
/**
* 適用於具有大量長段 而只縮減對話之間的空格使用
*/
...lazymarks['ln_talk'],
];
/**
* 實際使用的取代樣式
*/
export const words: IPatternRule["words"] = _word_zh_all([
...words_source,
...words_layout,
] as IWords[]);
/**
* 需要人工確認的屏蔽字或錯字用語等等
*/
export const words_maybe: IPatternRule["words_maybe"] = [
//'需要偵測的字',
];
/**
* 分析取代完成後執行的代碼
*
* @param {string} text
* @returns {string}
*/
export function words_callback(text: string): string
{
return text;
}
export default <IPatternRule>{
lang,
words_source,
words_layout,
words,
words_maybe,
words_callback,
}