scv-bilara 3.176.19 → 3.177.0

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": "scv-bilara",
3
- "version": "3.176.19",
3
+ "version": "3.177.0",
4
4
  "description": "SuttaCentral bilara-data library",
5
5
  "main": "index.js",
6
6
  "directories": {
@@ -15,7 +15,7 @@
15
15
  "log-instance": "^1.6.0",
16
16
  "memo-again": "^0.10.0",
17
17
  "merkle-json": "^2.2.0",
18
- "scv-esm": "^1.115.585",
18
+ "scv-esm": "^1.115.586",
19
19
  "suttacentral-api": "^2.17.57",
20
20
  "tmp": "^0.2.3"
21
21
  },
package/src/defines.cjs CHANGED
@@ -3,12 +3,12 @@ module.exports.DBG_EXEC = 0;
3
3
  module.exports.DBG_EXAMPLES = 0;
4
4
  module.exports.DBG_MLD = 0;
5
5
  module.exports.DBG = {
6
- FIND: 0,
7
6
  MLD_CTOR: 0,
8
7
  MLD_LOAD: 0,
9
8
  MLD_TITLES: 0,
10
9
  SEEKER: {
11
10
  CTOR: 0,
11
+ FIND: 0,
12
12
  FINDARGS: 0,
13
13
  GREP: 0,
14
14
  SLOWGREP: 0,
package/src/seeker.cjs CHANGED
@@ -534,7 +534,6 @@
534
534
  findArgs(args) {
535
535
  const msg = "Seeker.findArgs() ";
536
536
  const dbg = SEEKER.FINDARGS;
537
- const dbgv = DBG.VERBOSE;
538
537
  if (!(args instanceof Array)) {
539
538
  throw new Error("findArgs(?ARRAY-OF-ARGS?)");
540
539
  }
@@ -651,11 +650,11 @@
651
650
  case 'de':
652
651
  case 'en':
653
652
  searchLang = this.patternLanguage(pattern, lang)
654
- dbgv && console.log(msg, '[1]searchLang', searchLang);
653
+ dbg>1 && console.log(msg, '[1]searchLang', searchLang);
655
654
  break;
656
655
  default:
657
656
  searchLang = docLang;
658
- dbgv && console.log(msg, '[2]searchLangDoc', searchLang);
657
+ dbg>1 && console.log(msg, '[2]searchLangDoc', searchLang);
659
658
  break;
660
659
  }
661
660
  }
@@ -769,9 +768,10 @@
769
768
 
770
769
  find(...args) {
771
770
  const msg = "Seeker.find() ";
772
- let dbg = DBG.FIND;
771
+ let dbg = SEEKER.FIND;
773
772
  var { findMemo, memoizer } = this;
774
773
  var findArgs = this.findArgs(args);
774
+ dbg>1 && console.info(msg+'1.01', 'findArgs', findArgs);
775
775
  var that = this;
776
776
  var callSlowFind = (args) => {
777
777
  return that.slowFind.call(that, args);
@@ -871,16 +871,17 @@
871
871
  }
872
872
 
873
873
  async slowFind(findArgs) {
874
- const msg = "Seeker.slowFind() ";
874
+ const msg = "S4r.slowFind:";
875
875
  const dbg = SEEKER.SLOWFIND;
876
876
  try {
877
877
  var msStart = Date.now();
878
878
  let result;
879
+ dbg>1 && console.log(msg+'1.01', 'findArgs', findArgs);
879
880
  if (findArgs.trilingual) {
880
- dbg && console.log(msg, "[1]slowFind", findArgs.pattern);
881
+ dbg && console.log(msg+'1.1', "slowFindTrilingual", findArgs.pattern);
881
882
  result = this.slowFindTrilingual(findArgs)
882
883
  } else {
883
- dbg && console.log(msg, "[2]slowFindLegacy", findArgs.pattern);
884
+ dbg && console.log(msg+'1.2', "slowFindLegacy", findArgs.pattern);
884
885
  result = this.slowFindLegacy(findArgs);
885
886
  }
886
887
  var msElapsed = Date.now() - msStart;
@@ -1071,8 +1072,7 @@
1071
1072
 
1072
1073
  async slowFindTrilingual(findArgs) {
1073
1074
  const msg = "Seeker.slowFindTrilingual()";
1074
- const dbg = SEEKER.SLOWFIND || SEEKER.SLOWFINDID;
1075
- const dbgv = DBG.VERBOSE && dbg;
1075
+ const dbg = SEEKER.SLOWFINDTRILINGUAL;
1076
1076
  var msStart = Date.now();
1077
1077
  var {
1078
1078
  author,
@@ -1095,6 +1095,7 @@
1095
1095
  trilingual,
1096
1096
  types,
1097
1097
  } = findArgs;
1098
+ dbg>1 && console.log(msg+'1.01', 'findArgs', findArgs);
1098
1099
  var bd = this.bilaraData;
1099
1100
  var examples = bd.examples;
1100
1101
  var resultPattern = pattern;
@@ -1103,7 +1104,9 @@
1103
1104
  let isSuidPattern = SuttaCentralId.test(pattern);
1104
1105
 
1105
1106
  if (examples[lang] && examples[lang].indexOf(pattern) >= 0) {
1106
- searchLang = lang;
1107
+ // DEPRECATED: avoid overwriting assigned search language
1108
+ // Following code has no tests so effect of removal is unknown
1109
+ //searchLang = lang;
1107
1110
  }
1108
1111
 
1109
1112
  if (isSuidPattern) {
@@ -1296,6 +1299,7 @@
1296
1299
  tipitakaCategories,
1297
1300
  };
1298
1301
 
1302
+ dbg>1 && console.info(msg+'1.01', 'phraseSearch', searchOpts);
1299
1303
  var { lines, pattern: resultPattern } = await this.phraseSearch(
1300
1304
  searchOpts
1301
1305
  );