tag-checker 0.0.131 → 0.0.132
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/analyzeTag.js +1 -1
- package/src/checkPbOrder.js +2 -2
- package/src/detectTag.js +1 -1
- package/src/getTagRules.js +2 -1
- package/src/main.js +1 -1
package/package.json
CHANGED
package/src/analyzeTag.js
CHANGED
|
@@ -2,7 +2,7 @@ const volAnalyzeRegex = /<vol n="((\d+?)(-(\d+?))?)"/;
|
|
|
2
2
|
const sutraRegex = /<sutra id="[\da-zA-Z]*?[a-zA-Z]((\d+?)([a-zA-Z])?)"/;
|
|
3
3
|
const headAnalyzeRegex = /<head( n="(\d+?)"| (t|bo|tw|en|cn)="(.+?)")/;
|
|
4
4
|
const bampoRegex = /<bampo n="((\d+?)([a-zA-Z])?)\.(\d+?)"/;
|
|
5
|
-
const pb4AnalyzeRegex = /<pb id="((\d+?)(-(\d+?))?)-((\d+?)([
|
|
5
|
+
const pb4AnalyzeRegex = /<pb id="((\d+?)(-(\d+?))?)-((\d+?)([abcdef]))"/;
|
|
6
6
|
const pbAnalyzeRegex = /<pb id="((\d+?)(-(\d+?))?)-(\d+?)"/;
|
|
7
7
|
|
|
8
8
|
export function analyzeVol(fn, tagStr) {
|
package/src/checkPbOrder.js
CHANGED
|
@@ -52,7 +52,7 @@ function check2Pb4Order(store, lastBio, pbBio, looseMode) {
|
|
|
52
52
|
let {pbN: lastPbN, pbL: lastPbL, tag: lastTag, fn: lastFn} = lastBio;
|
|
53
53
|
let {pbN, pbL, tag, fn} = pbBio;
|
|
54
54
|
|
|
55
|
-
if (sameNumber(lastPbN, pbN) && correctPbL(lastPbL + pbL) || (numberAdd1(lastPbN, pbN) && 'a' === pbL && ('b' === lastPbL || 'd' === lastPbL))) {
|
|
55
|
+
if (sameNumber(lastPbN, pbN) && correctPbL(lastPbL + pbL) || (numberAdd1(lastPbN, pbN) && 'a' === pbL && ('b' === lastPbL || 'd' === lastPbL || 'f' === lastPbL))) {
|
|
56
56
|
return;
|
|
57
57
|
}
|
|
58
58
|
else if (looseMode && (numberJump(lastPbN, pbN) || numberAdd1(lastPbN, pbN))) {
|
|
@@ -64,7 +64,7 @@ function check2Pb4Order(store, lastBio, pbBio, looseMode) {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
function correctPbL(str) {
|
|
67
|
-
if ('ab' === str || 'bc' === str || 'cd' === str) {
|
|
67
|
+
if ('ab' === str || 'bc' === str || 'cd' === str || 'de' === str || 'ef' === str) {
|
|
68
68
|
return true;
|
|
69
69
|
}
|
|
70
70
|
}
|
package/src/detectTag.js
CHANGED
|
@@ -2,7 +2,7 @@ const vol = /<vol /;
|
|
|
2
2
|
const head = /<head /;
|
|
3
3
|
const bampo = /<bampo /;
|
|
4
4
|
const pb = /<pb /;
|
|
5
|
-
const pbWithSuffix = /<pb id="\d+?-(\d+?-)?\d+?[
|
|
5
|
+
const pbWithSuffix = /<pb id="\d+?-(\d+?-)?\d+?[abcdef]"\/>/;
|
|
6
6
|
|
|
7
7
|
export function detectPbType(str) {
|
|
8
8
|
return pbWithSuffix.test(str);
|
package/src/getTagRules.js
CHANGED
|
@@ -6,6 +6,7 @@ const sutraVsets = {
|
|
|
6
6
|
'lhasakangyur': 'h',
|
|
7
7
|
'conekangyur': 'C',
|
|
8
8
|
'urgakangyur': 'U',
|
|
9
|
+
'narthangkangyur': 'N',
|
|
9
10
|
'pekingkangyur': 'P',
|
|
10
11
|
// tengyur
|
|
11
12
|
'degetengyur': 'D',
|
|
@@ -88,7 +89,7 @@ const sutraV = sutraVsets[repo];
|
|
|
88
89
|
let tagRules = [
|
|
89
90
|
{
|
|
90
91
|
type: 'pb',
|
|
91
|
-
correctRegex: /^<pb id="\d+?-(\d+?-)?\d+?[
|
|
92
|
+
correctRegex: /^<pb id="\d+?-(\d+?-)?\d+?[abcdef]?"\/>$/mg,
|
|
92
93
|
suspectedRegex: /<pb /g,
|
|
93
94
|
tagNameStrRegex: /pb/g,
|
|
94
95
|
lineWithTagRegex: /^.*?pb.*$/mg
|
package/src/main.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const repo = process.argv[2];
|
|
2
2
|
const globPatt = './' + repo + '*/**/' + repo + '[0-9]*.xml';
|
|
3
|
-
const pbRegex = /<pb id="\d+?-(\d+?-)?\d+?[
|
|
3
|
+
const pbRegex = /<pb id="\d+?-(\d+?-)?\d+?[abcdef]?"\/>/;
|
|
4
4
|
|
|
5
5
|
import getTextObjs from './getTextObjs';
|
|
6
6
|
import checkTagFormat from './checkTagFormat.js';
|