@iebh/polyglot 4.7.1 → 4.7.2

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/data/v4.xlsx CHANGED
Binary file
@@ -347,7 +347,8 @@ var parse = function parse(query, options) {
347
347
  // Mesh term - PubMed syntax
348
348
  leaf.type = 'mesh';
349
349
  leaf.field = match[2] ? 'Mesh search (Not exploded)' : 'Mesh search (exploded)';
350
- if (/^["“”].*["“”]$/.test(leaf.content)) leaf.content = leaf.content.substr(1, leaf.content.length - 2); // Remove wrapping '"' characters
350
+ // if (/^["“”].*["“”]$/.test(leaf.content)) leaf.content = leaf.content.substr(1, leaf.content.length - 2); // Remove wrapping '"' characters
351
+ if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content[0]) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content.slice(-1))) leaf.content = leaf.content.slice(1, -1);
351
352
  offset += match[0].length;
352
353
  q = q.substr(match[0].length);
353
354
  cropString = false;
@@ -360,7 +361,8 @@ var parse = function parse(query, options) {
360
361
  newLeaf.heading = match[2];
361
362
  }
362
363
  newLeaf.field = match[4] ? 'MeSH Major Topic search (Not exploded)' : 'MeSH Major Topic search (exploded)';
363
- if (/^["“”].*["“”]$/.test(newLeaf.content)) newLeaf.content = newLeaf.content.substr(1, newLeaf.content.length - 2); // Remove wrapping '"' characters
364
+ // if (/^["“”].*["“”]$/.test(newLeaf.content)) newLeaf.content = newLeaf.content.substr(1, newLeaf.content.length - 2); // Remove wrapping '"' characters
365
+ if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content[0]) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content.slice(-1))) leaf.content = leaf.content.slice(1, -1);
364
366
  branch.nodes.push(newLeaf);
365
367
  offset += match[0].length;
366
368
  q = q.substr(match[0].length);
@@ -374,7 +376,8 @@ var parse = function parse(query, options) {
374
376
  newLeaf.heading = match[2];
375
377
  }
376
378
  newLeaf.field = match[4] ? 'MeSH Major Topic search (Not exploded)' : 'MeSH Major Topic search (exploded)';
377
- if (/^["“”].*["“”]$/.test(newLeaf.content)) newLeaf.content = newLeaf.content.substr(1, newLeaf.content.length - 2); // Remove wrapping '"' characters
379
+ // if (/^["“”].*["“”]$/.test(newLeaf.content)) newLeaf.content = newLeaf.content.substr(1, newLeaf.content.length - 2); // Remove wrapping '"' characters
380
+ if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content[0]) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content.slice(-1))) leaf.content = leaf.content.slice(1, -1);
378
381
  branch.nodes.push(newLeaf);
379
382
  offset += match[0].length;
380
383
  q = q.substr(match[0].length);
@@ -383,7 +386,8 @@ var parse = function parse(query, options) {
383
386
  // Mesh subheading search - PubMed syntax
384
387
  leaf.type = 'mesh';
385
388
  leaf.field = 'MeSH subheading search';
386
- if (/^["“”].*["“”]$/.test(leaf.content)) leaf.content = leaf.content.substr(1, leaf.content.length - 2); // Remove wrapping '"' characters
389
+ // if (/^["“”].*["“”]$/.test(leaf.content)) leaf.content = leaf.content.substr(1, leaf.content.length - 2); // Remove wrapping '"' characters
390
+ if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content[0]) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content.slice(-1))) leaf.content = leaf.content.slice(1, -1);
387
391
  offset += match[0].length;
388
392
  q = q.substr(match[0].length);
389
393
  cropString = false;
@@ -397,7 +401,8 @@ var parse = function parse(query, options) {
397
401
  }
398
402
  leaf.type = 'mesh';
399
403
  useLeaf.field = 'MeSH subheading search';
400
- if (/^["“”].*["“”]$/.test(leaf.content)) leaf.content = leaf.content.substr(1, leaf.content.length - 2); // Remove wrapping '"' characters
404
+ // if (/^["“”].*["“”]$/.test(leaf.content)) leaf.content = leaf.content.substr(1, leaf.content.length - 2); // Remove wrapping '"' characters
405
+ if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content[0]) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content.slice(-1))) leaf.content = leaf.content.slice(1, -1);
401
406
  offset += match[0].length;
402
407
  q = q.substr(match[0].length);
403
408
  cropString = false;
@@ -411,7 +416,8 @@ var parse = function parse(query, options) {
411
416
  }
412
417
  leaf.type = 'mesh';
413
418
  useLeaf.field = match[1] === "xm" ? 'Mesh search (exploded)' : 'Mesh search (Not exploded)';
414
- if (/^["“”].*["“”]$/.test(leaf.content)) leaf.content = leaf.content.substr(1, leaf.content.length - 2); // Remove wrapping '"' characters
419
+ // if (/^["“”].*["“”]$/.test(leaf.content)) leaf.content = leaf.content.substr(1, leaf.content.length - 2); // Remove wrapping '"' characters
420
+ if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content[0]) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content.slice(-1))) leaf.content = leaf.content.slice(1, -1);
415
421
  offset += match[0].length;
416
422
  q = q.substr(match[0].length);
417
423
  cropString = false;
@@ -527,8 +533,8 @@ var parse = function parse(query, options) {
527
533
  var nextChar = q.substr(0, 1);
528
534
  if ((_lodash["default"].isUndefined(leaf) || _lodash["default"].isArray(leaf)) && nextChar != ' ') {
529
535
  // Leaf pointing to array entity - probably not created fallback leaf to append to
530
- if (/^["“”]$/.test(nextChar) && (match = /^["“”](.*?)["“”]/.exec(q))) {
531
- // First character is a speachmark - slurp until we see the next one
536
+ // if (/^["“”]$/.test(nextChar) && (match = /^["“”](.*?)["“”]/.exec(q))) { // First character is a speachmark - slurp until we see the next one
537
+ if (/^["“”'‘’]$/.test(nextChar) && (match = /^["“”'‘’](.*?)["“”'‘’]/.exec(q))) {
532
538
  leaf = {
533
539
  type: 'phrase',
534
540
  content: match[1],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iebh/polyglot",
3
- "version": "4.7.1",
3
+ "version": "4.7.2",
4
4
  "description": "IEBH-SRA tool to convert between different medical database search formats",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
package/data/~$v4.xlsx DELETED
Binary file