tag-checker 0.0.145 → 0.0.147

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tag-checker",
3
- "version": "0.0.145",
3
+ "version": "0.0.147",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
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+?)([abcdef]))"/;
5
+ const pb4AnalyzeRegex = /<pb id="((\d+?)(-(\d+?))?)-((\d+?)([a-z]))"/;
6
6
  const pbAnalyzeRegex = /<pb id="((\d+?)(-(\d+?))?)-(\d+?)"/;
7
7
 
8
8
  export function analyzeVol(fn, tagStr) {
@@ -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 || 'de' === str || 'ef' === str) {
67
+ if (str.charCodeAt(1) - str.charCodeAt(0) === 1) {
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+?[abcdef]"\/>/;
5
+ const pbWithSuffix = /<pb id="\d+?-(\d+?-)?\d+?[a-z]"\/>/;
6
6
 
7
7
  export function detectPbType(str) {
8
8
  return pbWithSuffix.test(str);
@@ -136,7 +136,7 @@ const sutraVsets = {
136
136
  'terdzo': 'TD',
137
137
  "bshadmdzod": "AK",
138
138
  // 法王外文書
139
- 'buddisttextchinesemordentranslation': 'BTCMT',
139
+ 'buddisttextchinesemordentranslation': 'buddisttextchinesemordentranslation',
140
140
  'mbas': 'mbas',
141
141
  'fgbt': 'fgbt',
142
142
  'gjbs': 'gjbs',
@@ -182,7 +182,7 @@ const sutraV = sutraVsets[repo];
182
182
  let tagRules = [
183
183
  {
184
184
  type: 'pb',
185
- correctRegex: /^<pb id="\d+?-(\d+?-)?\d+?[abcdef]?"\/>$/mg,
185
+ correctRegex: /^<pb id="\d+?-(\d+?-)?\d+?[a-z]?"\/>$/mg,
186
186
  suspectedRegex: /<pb /g,
187
187
  tagNameStrRegex: /pb/g,
188
188
  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+?[abcdef]?"\/>/;
3
+ const pbRegex = /<pb id="\d+?-(\d+?-)?\d+?[a-z]?"\/>/;
4
4
 
5
5
  import getTextObjs from './getTextObjs';
6
6
  import checkTagFormat from './checkTagFormat.js';