@iebh/polyglot 4.7.1 → 4.7.3
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 +0 -0
- package/lib/modules/parse.js +21 -8
- package/package.json +1 -1
- package/data/~$v4.xlsx +0 -0
package/data/v4.xlsx
CHANGED
|
Binary file
|
package/lib/modules/parse.js
CHANGED
|
@@ -347,7 +347,10 @@ 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)) leaf.content = leaf.content.substr(1, leaf.content.length - 2); // Remove wrapping '"' characters
|
|
352
|
+
// if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content[0]) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content.slice(-1))) leaf.content = leaf.content.slice(1, -1);
|
|
353
|
+
|
|
351
354
|
offset += match[0].length;
|
|
352
355
|
q = q.substr(match[0].length);
|
|
353
356
|
cropString = false;
|
|
@@ -360,7 +363,9 @@ var parse = function parse(query, options) {
|
|
|
360
363
|
newLeaf.heading = match[2];
|
|
361
364
|
}
|
|
362
365
|
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
|
|
366
|
+
// if (/^["“”].*["“”]$/.test(newLeaf.content)) newLeaf.content = newLeaf.content.substr(1, newLeaf.content.length - 2); // Remove wrapping '"' characters
|
|
367
|
+
if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content)) leaf.content = leaf.content.substr(1, leaf.content.length - 2); // Remove wrapping '"' characters
|
|
368
|
+
// if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content[0]) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content.slice(-1))) leaf.content = leaf.content.slice(1, -1);
|
|
364
369
|
branch.nodes.push(newLeaf);
|
|
365
370
|
offset += match[0].length;
|
|
366
371
|
q = q.substr(match[0].length);
|
|
@@ -374,7 +379,9 @@ var parse = function parse(query, options) {
|
|
|
374
379
|
newLeaf.heading = match[2];
|
|
375
380
|
}
|
|
376
381
|
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
|
|
382
|
+
// if (/^["“”].*["“”]$/.test(newLeaf.content)) newLeaf.content = newLeaf.content.substr(1, newLeaf.content.length - 2); // Remove wrapping '"' characters
|
|
383
|
+
if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content)) leaf.content = leaf.content.substr(1, leaf.content.length - 2); // Remove wrapping '"' characters
|
|
384
|
+
// if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content[0]) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content.slice(-1))) leaf.content = leaf.content.slice(1, -1);
|
|
378
385
|
branch.nodes.push(newLeaf);
|
|
379
386
|
offset += match[0].length;
|
|
380
387
|
q = q.substr(match[0].length);
|
|
@@ -383,7 +390,9 @@ var parse = function parse(query, options) {
|
|
|
383
390
|
// Mesh subheading search - PubMed syntax
|
|
384
391
|
leaf.type = 'mesh';
|
|
385
392
|
leaf.field = 'MeSH subheading search';
|
|
386
|
-
if (/^["“”].*["“”]$/.test(leaf.content)) leaf.content = leaf.content.substr(1, leaf.content.length - 2); // Remove wrapping '"' characters
|
|
393
|
+
// if (/^["“”].*["“”]$/.test(leaf.content)) leaf.content = leaf.content.substr(1, leaf.content.length - 2); // Remove wrapping '"' characters
|
|
394
|
+
if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content)) leaf.content = leaf.content.substr(1, leaf.content.length - 2); // Remove wrapping '"' characters
|
|
395
|
+
// if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content[0]) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content.slice(-1))) leaf.content = leaf.content.slice(1, -1);
|
|
387
396
|
offset += match[0].length;
|
|
388
397
|
q = q.substr(match[0].length);
|
|
389
398
|
cropString = false;
|
|
@@ -397,7 +406,9 @@ var parse = function parse(query, options) {
|
|
|
397
406
|
}
|
|
398
407
|
leaf.type = 'mesh';
|
|
399
408
|
useLeaf.field = 'MeSH subheading search';
|
|
400
|
-
if (/^["“”].*["“”]$/.test(leaf.content)) leaf.content = leaf.content.substr(1, leaf.content.length - 2); // Remove wrapping '"' characters
|
|
409
|
+
// if (/^["“”].*["“”]$/.test(leaf.content)) leaf.content = leaf.content.substr(1, leaf.content.length - 2); // Remove wrapping '"' characters
|
|
410
|
+
if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content)) leaf.content = leaf.content.substr(1, leaf.content.length - 2); // Remove wrapping '"' characters
|
|
411
|
+
// if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content[0]) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content.slice(-1))) leaf.content = leaf.content.slice(1, -1);
|
|
401
412
|
offset += match[0].length;
|
|
402
413
|
q = q.substr(match[0].length);
|
|
403
414
|
cropString = false;
|
|
@@ -411,7 +422,9 @@ var parse = function parse(query, options) {
|
|
|
411
422
|
}
|
|
412
423
|
leaf.type = 'mesh';
|
|
413
424
|
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
|
|
425
|
+
// if (/^["“”].*["“”]$/.test(leaf.content)) leaf.content = leaf.content.substr(1, leaf.content.length - 2); // Remove wrapping '"' characters
|
|
426
|
+
if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content)) leaf.content = leaf.content.substr(1, leaf.content.length - 2); // Remove wrapping '"' characters
|
|
427
|
+
// if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content[0]) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content.slice(-1))) leaf.content = leaf.content.slice(1, -1);
|
|
415
428
|
offset += match[0].length;
|
|
416
429
|
q = q.substr(match[0].length);
|
|
417
430
|
cropString = false;
|
|
@@ -527,8 +540,8 @@ var parse = function parse(query, options) {
|
|
|
527
540
|
var nextChar = q.substr(0, 1);
|
|
528
541
|
if ((_lodash["default"].isUndefined(leaf) || _lodash["default"].isArray(leaf)) && nextChar != ' ') {
|
|
529
542
|
// Leaf pointing to array entity - probably not created fallback leaf to append to
|
|
530
|
-
if (/^["“”]$/.test(nextChar) && (match = /^["“”](.*?)["“”]/.exec(q))) {
|
|
531
|
-
|
|
543
|
+
// if (/^["“”]$/.test(nextChar) && (match = /^["“”](.*?)["“”]/.exec(q))) { // First character is a speachmark - slurp until we see the next one
|
|
544
|
+
if (/^["“”'‘’]$/.test(nextChar) && (match = /^["“”'‘’](.*?)["“”'‘’]/.exec(q))) {
|
|
532
545
|
leaf = {
|
|
533
546
|
type: 'phrase',
|
|
534
547
|
content: match[1],
|
package/package.json
CHANGED
package/data/~$v4.xlsx
DELETED
|
Binary file
|