js-solr-highlighter
Advanced tools
Comparing version 0.6.5 to 0.6.6
@@ -160,5 +160,7 @@ import { highlightByQuery } from './index.js' | ||
const query = 'methylation test' | ||
const content = 'epiCaPture: A Urine DNA Methylation Test for Early Detection of Aggressive Prostate Cancer.' | ||
const content = | ||
'epiCaPture: A Urine DNA Methylation Test for Early Detection of Aggressive Prostate Cancer.' | ||
const received = highlightByQuery(query, content, options) | ||
const expected = 'epiCaPture: A Urine DNA <span id=\"highlight-0\" class=\"extra-bold\">Methylation</span> <span id=\"highlight-1\" class=\"extra-bold\">Test</span> for Early Detection of Aggressive Prostate Cancer.' | ||
const expected = | ||
'epiCaPture: A Urine DNA <span id="highlight-0" class="extra-bold">Methylation</span> <span id="highlight-1" class="extra-bold">Test</span> for Early Detection of Aggressive Prostate Cancer.' | ||
expect(received).toBe(expected) | ||
@@ -169,5 +171,7 @@ }) | ||
const query = 'TITLE:blood' | ||
const content = 'A molecular map of lymph node blood vascular endothelium at single cell resolution' | ||
const content = | ||
'A molecular map of lymph node blood vascular endothelium at single cell resolution' | ||
const received = highlightByQuery(query, content, options) | ||
const expected = 'A molecular map of lymph node <span id=\"highlight-0\" class=\"extra-bold\">blood</span> vascular endothelium at single cell resolution' | ||
const expected = | ||
'A molecular map of lymph node <span id="highlight-0" class="extra-bold">blood</span> vascular endothelium at single cell resolution' | ||
expect(received).toBe(expected) | ||
@@ -178,5 +182,7 @@ }) | ||
const query = '"electrode array"' | ||
const content = 'Towards emerging EEG applications: a novel printable flexible Ag/AgCl dry electrode array for robust recording of EEG signals at forehead sites.' | ||
const content = | ||
'Towards emerging EEG applications: a novel printable flexible Ag/AgCl dry electrode array for robust recording of EEG signals at forehead sites.' | ||
const received = highlightByQuery(query, content, options) | ||
const expected = 'Towards emerging EEG applications: a novel printable flexible Ag/AgCl dry <span id=\"highlight-0\" class=\"extra-bold\">electrode array</span> for robust recording of EEG signals at forehead sites.' | ||
const expected = | ||
'Towards emerging EEG applications: a novel printable flexible Ag/AgCl dry <span id="highlight-0" class="extra-bold">electrode array</span> for robust recording of EEG signals at forehead sites.' | ||
expect(received).toBe(expected) | ||
@@ -187,5 +193,7 @@ }) | ||
const query = 'ACK_FUND:"Prostate Cancer UK"' | ||
const content = 'PIM kinase inhibition: co-targeted therapeutic approaches in prostate cancer.' | ||
const content = | ||
'PIM kinase inhibition: co-targeted therapeutic approaches in prostate cancer.' | ||
const received = highlightByQuery(query, content, options) | ||
const expected = 'PIM kinase inhibition: co-targeted therapeutic approaches in prostate cancer.' | ||
const expected = | ||
'PIM kinase inhibition: co-targeted therapeutic approaches in prostate cancer.' | ||
expect(received).toBe(expected) | ||
@@ -196,5 +204,7 @@ }) | ||
const query = 'ACK_FUND:"Prostate Cancer UK"' | ||
const content = 'MIFlowCyt-EV: a framework for standardized reporting of extracellular vesicle flow cytometry experiments.' | ||
const content = | ||
'MIFlowCyt-EV: a framework for standardized reporting of extracellular vesicle flow cytometry experiments.' | ||
const received = highlightByQuery(query, content, options) | ||
const expected = 'MIFlowCyt-EV: a framework for standardized reporting of extracellular vesicle flow cytometry experiments.' | ||
const expected = | ||
'MIFlowCyt-EV: a framework for standardized reporting of extracellular vesicle flow cytometry experiments.' | ||
expect(received).toBe(expected) | ||
@@ -205,5 +215,7 @@ }) | ||
const query = 'blood in the brain' | ||
const content = 'Autophagy-mediated occludin degradation contributes to blood-brain barrier disruption during ischemia in bEnd.3 brain endothelial cells and rat ischemic stroke models.' | ||
const content = | ||
'Autophagy-mediated occludin degradation contributes to blood-brain barrier disruption during ischemia in bEnd.3 brain endothelial cells and rat ischemic stroke models.' | ||
const received = highlightByQuery(query, content, options) | ||
const expected = 'Autophagy-mediated occludin degradation contributes to <span id=\"highlight-0\" class=\"extra-bold\">blood</span>-<span id=\"highlight-1\" class=\"extra-bold\">brain</span> barrier disruption during ischemia in bEnd.3 <span id=\"highlight-2\" class=\"extra-bold\">brain</span> endothelial cells and rat ischemic stroke models.' | ||
const expected = | ||
'Autophagy-mediated occludin degradation contributes to <span id="highlight-0" class="extra-bold">blood</span>-<span id="highlight-1" class="extra-bold">brain</span> barrier disruption during ischemia in bEnd.3 <span id="highlight-2" class="extra-bold">brain</span> endothelial cells and rat ischemic stroke models.' | ||
expect(received).toBe(expected) | ||
@@ -222,5 +234,7 @@ }) | ||
const query = 'cancer AND blood' | ||
const content = 'Platelet Volume Is Reduced In Metastasing Breast Cancer: Blood Profiles Reveal Significant Shifts.' | ||
const content = | ||
'Platelet Volume Is Reduced In Metastasing Breast Cancer: Blood Profiles Reveal Significant Shifts.' | ||
const received = highlightByQuery(query, content, options) | ||
const expected = 'Platelet Volume Is Reduced In Metastasing Breast <span id=\"highlight-0\" class=\"extra-bold\">Cancer</span>: <span id=\"highlight-1\" class=\"extra-bold\">Blood</span> Profiles Reveal Significant Shifts.' | ||
const expected = | ||
'Platelet Volume Is Reduced In Metastasing Breast <span id="highlight-0" class="extra-bold">Cancer</span>: <span id="highlight-1" class="extra-bold">Blood</span> Profiles Reveal Significant Shifts.' | ||
expect(received).toBe(expected) | ||
@@ -233,3 +247,4 @@ }) | ||
const received = highlightByQuery(query, content, options) | ||
const expected = 'New <span id=\"highlight-0\" class=\"extra-bold\">cancer</span> <span id=\"highlight-1\" class=\"extra-bold\">blood</span> test developed.' | ||
const expected = | ||
'New <span id="highlight-0" class="extra-bold">cancer</span> <span id="highlight-1" class="extra-bold">blood</span> test developed.' | ||
expect(received).toBe(expected) | ||
@@ -240,5 +255,7 @@ }) | ||
const query = 'cancer NOT blood' | ||
const content = 'Efficacy of kinesio taping in early stage breast cancer associated lymphedema: A randomized single blinded study.' | ||
const content = | ||
'Efficacy of kinesio taping in early stage breast cancer associated lymphedema: A randomized single blinded study.' | ||
const received = highlightByQuery(query, content, options) | ||
const expected = 'Efficacy of kinesio taping in early stage breast <span id=\"highlight-0\" class=\"extra-bold\">cancer</span> associated lymphedema: A randomized single blinded study.' | ||
const expected = | ||
'Efficacy of kinesio taping in early stage breast <span id="highlight-0" class="extra-bold">cancer</span> associated lymphedema: A randomized single blinded study.' | ||
expect(received).toBe(expected) | ||
@@ -249,5 +266,7 @@ }) | ||
const query = '(ACK_FUND:"Prostate Cancer UK") biopsy' | ||
const content = 'A multicentre parallel-group randomised trial assessing multiparametric MRI characterisation and image-guided biopsy of prostate in men suspected of having prostate cancer: MULTIPROS study protocol.' | ||
const content = | ||
'A multicentre parallel-group randomised trial assessing multiparametric MRI characterisation and image-guided biopsy of prostate in men suspected of having prostate cancer: MULTIPROS study protocol.' | ||
const received = highlightByQuery(query, content, options) | ||
const expected = 'A multicentre parallel-group randomised trial assessing multiparametric MRI characterisation and image-guided <span id=\"highlight-0\" class=\"extra-bold\">biopsy</span> of prostate in men suspected of having prostate cancer: MULTIPROS study protocol.' | ||
const expected = | ||
'A multicentre parallel-group randomised trial assessing multiparametric MRI characterisation and image-guided <span id="highlight-0" class="extra-bold">biopsy</span> of prostate in men suspected of having prostate cancer: MULTIPROS study protocol.' | ||
expect(received).toBe(expected) | ||
@@ -258,5 +277,7 @@ }) | ||
const query = '(blood test)' | ||
const content = '[Predictive values of routine blood test results for iron deficiency in children].' | ||
const content = | ||
'[Predictive values of routine blood test results for iron deficiency in children].' | ||
const received = highlightByQuery(query, content, options) | ||
const expected = '[Predictive values of routine <span id=\"highlight-0\" class=\"extra-bold\">blood</span> <span id=\"highlight-1\" class=\"extra-bold\">test</span> results for iron deficiency in children].' | ||
const expected = | ||
'[Predictive values of routine <span id="highlight-0" class="extra-bold">blood</span> <span id="highlight-1" class="extra-bold">test</span> results for iron deficiency in children].' | ||
expect(received).toBe(expected) | ||
@@ -266,6 +287,9 @@ }) | ||
test('(ACK_FUND:"Prostate Cancer UK") NOT (grant_agency:"Prostate Cancer UK" AND SRC:med)', () => { | ||
const query = '(ACK_FUND:"Prostate Cancer UK") NOT (grant_agency:"Prostate Cancer UK" AND SRC:med)' | ||
const content = 'PIM kinase inhibition: co-targeted therapeutic approaches in prostate cancer.' | ||
const query = | ||
'(ACK_FUND:"Prostate Cancer UK") NOT (grant_agency:"Prostate Cancer UK" AND SRC:med)' | ||
const content = | ||
'PIM kinase inhibition: co-targeted therapeutic approaches in prostate cancer.' | ||
const received = highlightByQuery(query, content, options) | ||
const expected = 'PIM kinase inhibition: co-targeted therapeutic approaches in prostate cancer.' | ||
const expected = | ||
'PIM kinase inhibition: co-targeted therapeutic approaches in prostate cancer.' | ||
expect(received).toBe(expected) | ||
@@ -276,5 +300,7 @@ }) | ||
const query = 'cancer cancer' | ||
const content = 'Diabetes and Cancer: Cancer Should Be Screened in Routine Diabetes Assessment.' | ||
const content = | ||
'Diabetes and Cancer: Cancer Should Be Screened in Routine Diabetes Assessment.' | ||
const received = highlightByQuery(query, content, options) | ||
const expected = 'Diabetes and <span id=\"highlight-2\" class=\"extra-bold\"><span id=\"highlight-0\" class=\"extra-bold\">Cancer</span></span>: <span id=\"highlight-3\" class=\"extra-bold\"><span id=\"highlight-1\" class=\"extra-bold\">Cancer</span></span> Should Be Screened in Routine Diabetes Assessment.' | ||
const expected = | ||
'Diabetes and <span id="highlight-2" class="extra-bold"><span id="highlight-0" class="extra-bold">Cancer</span></span>: <span id="highlight-3" class="extra-bold"><span id="highlight-1" class="extra-bold">Cancer</span></span> Should Be Screened in Routine Diabetes Assessment.' | ||
expect(received).toBe(expected) | ||
@@ -285,5 +311,7 @@ }) | ||
const query = 'HAS_ABSTRACT:Y AND blood' | ||
const content = 'Genetic disruption of the Blood Brain Barrier leads to protective barrier formation at the Glia Limitans' | ||
const content = | ||
'Genetic disruption of the Blood Brain Barrier leads to protective barrier formation at the Glia Limitans' | ||
const received = highlightByQuery(query, content, options) | ||
const expected = 'Genetic disruption of the <span id=\"highlight-0\" class=\"extra-bold\">Blood</span> Brain Barrier leads to protective barrier formation at the Glia Limitans' | ||
const expected = | ||
'Genetic disruption of the <span id="highlight-0" class="extra-bold">Blood</span> Brain Barrier leads to protective barrier formation at the Glia Limitans' | ||
expect(received).toBe(expected) | ||
@@ -293,6 +321,9 @@ }) | ||
test('Evidence that intentions based on attitudes better predict behavior than intentions based on subjective norms', () => { | ||
const query = 'Evidence that intentions based on attitudes better predict behavior than intentions based on subjective norms' | ||
const content = 'The Campbell Paradigm as a Behavior-Predictive Reinterpretation of the Classical Tripartite Model of Attitudes.' | ||
const query = | ||
'Evidence that intentions based on attitudes better predict behavior than intentions based on subjective norms' | ||
const content = | ||
'The Campbell Paradigm as a Behavior-Predictive Reinterpretation of the Classical Tripartite Model of Attitudes.' | ||
const received = highlightByQuery(query, content, options) | ||
const expected = 'The Campbell Paradigm as a <span id=\"highlight-2\" class=\"extra-bold\">Behavior</span>-Predictive Reinterpretation of the Classical Tripartite Model of <span id=\"highlight-0\" class=\"extra-bold\">Attitudes</span>.' | ||
const expected = | ||
'The Campbell Paradigm as a <span id="highlight-2" class="extra-bold">Behavior</span>-Predictive Reinterpretation of the Classical Tripartite Model of <span id="highlight-0" class="extra-bold">Attitudes</span>.' | ||
expect(received).toBe(expected) | ||
@@ -303,5 +334,7 @@ }) | ||
const query = 'A theory-based study of doctors' | ||
const content = 'A theory-based study of doctors\' intentions to engage in professional behaviours.' | ||
const content = | ||
"A theory-based study of doctors' intentions to engage in professional behaviours." | ||
const received = highlightByQuery(query, content, options) | ||
const expected = 'A <span id=\"highlight-0\" class=\"extra-bold\">theory-based</span> <span id=\"highlight-1\" class=\"extra-bold\">study</span> of <span id=\"highlight-2\" class=\"extra-bold\">doctors</span>\' intentions to engage in professional behaviours.' | ||
const expected = | ||
'A <span id="highlight-0" class="extra-bold">theory-based</span> <span id="highlight-1" class="extra-bold">study</span> of <span id="highlight-2" class="extra-bold">doctors</span>\' intentions to engage in professional behaviours.' | ||
expect(received).toBe(expected) | ||
@@ -312,5 +345,7 @@ }) | ||
const query = 'above' | ||
const content = 'High definition ultrasound imaging of the individual elements of the brachial plexus above the clavicle.' | ||
const content = | ||
'High definition ultrasound imaging of the individual elements of the brachial plexus above the clavicle.' | ||
const received = highlightByQuery(query, content, options) | ||
const expected = 'High definition ultrasound imaging of the individual elements of the brachial plexus <span id=\"highlight-0\" class=\"extra-bold\">above</span> the clavicle.' | ||
const expected = | ||
'High definition ultrasound imaging of the individual elements of the brachial plexus <span id="highlight-0" class="extra-bold">above</span> the clavicle.' | ||
expect(received).toBe(expected) | ||
@@ -338,5 +373,7 @@ }) | ||
const query = 'brain barrier' | ||
const content = 'Genetic disruption of the Blood Brain Barrier leads to protective barrier formation at the Glia Limitans' | ||
const content = | ||
'Genetic disruption of the Blood Brain Barrier leads to protective barrier formation at the Glia Limitans' | ||
const received = highlightByQuery(query, content, options) | ||
const expected = 'Genetic disruption of the Blood <span id=\"highlight-0\" class=\"extra-bold\">Brain</span> <span id=\"highlight-1\" class=\"extra-bold\">Barrier</span> leads to protective <span id=\"highlight-2\" class=\"extra-bold\">barrier</span> formation at the Glia Limitans' | ||
const expected = | ||
'Genetic disruption of the Blood <span id="highlight-0" class="extra-bold">Brain</span> <span id="highlight-1" class="extra-bold">Barrier</span> leads to protective <span id="highlight-2" class="extra-bold">barrier</span> formation at the Glia Limitans' | ||
expect(received).toBe(expected) | ||
@@ -346,6 +383,9 @@ }) | ||
test('Roles of H3K36-specific histone methyltransferases in transcription: b', () => { | ||
const query = 'Roles of H3K36-specific histone methyltransferases in transcription: b' | ||
const content = 'Histone Methyltransferases as Therapeutic Targets for Kidney Diseases.' | ||
const query = | ||
'Roles of H3K36-specific histone methyltransferases in transcription: b' | ||
const content = | ||
'Histone Methyltransferases as Therapeutic Targets for Kidney Diseases.' | ||
const received = highlightByQuery(query, content, options) | ||
const expected = '<span id=\"highlight-0\" class=\"extra-bold\">Histone</span> <span id=\"highlight-1\" class=\"extra-bold\">Methyltransferases</span> as Therapeutic Targets for Kidney Diseases.' | ||
const expected = | ||
'<span id="highlight-0" class="extra-bold">Histone</span> <span id="highlight-1" class="extra-bold">Methyltransferases</span> as Therapeutic Targets for Kidney Diseases.' | ||
expect(received).toBe(expected) | ||
@@ -356,5 +396,7 @@ }) | ||
const query = 'HIV/AIDS' | ||
const content = 'Continuous renal replacement therapy in patients with HIV/AIDS.' | ||
const content = | ||
'Continuous renal replacement therapy in patients with HIV/AIDS.' | ||
const received = highlightByQuery(query, content, options) | ||
const expected = 'Continuous renal replacement therapy in patients with <span id=\"highlight-0\" class=\"extra-bold\">HIV/AIDS</span>.' | ||
const expected = | ||
'Continuous renal replacement therapy in patients with <span id="highlight-0" class="extra-bold">HIV/AIDS</span>.' | ||
expect(received).toBe(expected) | ||
@@ -365,5 +407,7 @@ }) | ||
const query = 'Blood pressure-related' | ||
const content = 'Blood pressure-related electrocardiographic findings in healthy young individuals.' | ||
const content = | ||
'Blood pressure-related electrocardiographic findings in healthy young individuals.' | ||
const received = highlightByQuery(query, content, options) | ||
const expected = '<span id=\"highlight-0\" class=\"extra-bold\">Blood</span> <span id=\"highlight-1\" class=\"extra-bold\">pressure-related</span> electrocardiographic findings in healthy young individuals.' | ||
const expected = | ||
'<span id="highlight-0" class="extra-bold">Blood</span> <span id="highlight-1" class="extra-bold">pressure-related</span> electrocardiographic findings in healthy young individuals.' | ||
expect(received).toBe(expected) | ||
@@ -374,5 +418,7 @@ }) | ||
const query = 'complex blood AND (HAS_FT:Y)' | ||
const content = 'Use of magnoflorine-phospholipid complex to permeate blood-brain barrier and treat depression in the CUMS animal model.' | ||
const content = | ||
'Use of magnoflorine-phospholipid complex to permeate blood-brain barrier and treat depression in the CUMS animal model.' | ||
const received = highlightByQuery(query, content, options) | ||
const expected = 'Use of magnoflorine-phospholipid <span id=\"highlight-0\" class=\"extra-bold\">complex</span> to permeate <span id=\"highlight-1\" class=\"extra-bold\">blood</span>-brain barrier and treat depression in the CUMS animal model.' | ||
const expected = | ||
'Use of magnoflorine-phospholipid <span id="highlight-0" class="extra-bold">complex</span> to permeate <span id="highlight-1" class="extra-bold">blood</span>-brain barrier and treat depression in the CUMS animal model.' | ||
expect(received).toBe(expected) | ||
@@ -383,5 +429,7 @@ }) | ||
const query = 'cancer?' | ||
const content = 'A network Based method to predict cancer causal genes in GR Network.' | ||
const content = | ||
'A network Based method to predict cancer causal genes in GR Network.' | ||
const received = highlightByQuery(query, content, options) | ||
const expected = 'A network Based method to predict <span id=\"highlight-0\" class=\"extra-bold\">cancer</span> causal genes in GR Network.' | ||
const expected = | ||
'A network Based method to predict <span id="highlight-0" class="extra-bold">cancer</span> causal genes in GR Network.' | ||
expect(received).toBe(expected) | ||
@@ -392,5 +440,7 @@ }) | ||
const query = 'cancer of neck' | ||
const content = 'Management delays in patients with squamous cell cancer of neck node(s) and unknown primary site: a retrospective cohort study.' | ||
const content = | ||
'Management delays in patients with squamous cell cancer of neck node(s) and unknown primary site: a retrospective cohort study.' | ||
const received = highlightByQuery(query, content, options) | ||
const expected = 'Management delays in patients with squamous cell <span id=\"highlight-0\" class=\"extra-bold\">cancer</span> of <span id=\"highlight-1\" class=\"extra-bold\">neck</span> node(s) and unknown primary site: a retrospective cohort study.' | ||
const expected = | ||
'Management delays in patients with squamous cell <span id="highlight-0" class="extra-bold">cancer</span> of <span id="highlight-1" class="extra-bold">neck</span> node(s) and unknown primary site: a retrospective cohort study.' | ||
expect(received).toBe(expected) | ||
@@ -401,5 +451,7 @@ }) | ||
const query = 'INTRO:Aprotein interactions' | ||
const content = 'GR Utilizes a Co-Chaperone Cytoplasmic CAR Retention Protein to Form an N/C Interaction.' | ||
const content = | ||
'GR Utilizes a Co-Chaperone Cytoplasmic CAR Retention Protein to Form an N/C Interaction.' | ||
const received = highlightByQuery(query, content, options) | ||
const expected = 'GR Utilizes a Co-Chaperone Cytoplasmic CAR Retention Protein to Form an N/C Interaction.' | ||
const expected = | ||
'GR Utilizes a Co-Chaperone Cytoplasmic CAR Retention Protein to Form an N/C Interaction.' | ||
expect(received).toBe(expected) | ||
@@ -410,5 +462,7 @@ }) | ||
const query = 'TITLE:"bl2' | ||
const content = 'Antiobesity Effect of Garlic Extract Fermented by Lactobacillus plantarum BL2 in Diet-Induced Obese Mice.' | ||
const content = | ||
'Antiobesity Effect of Garlic Extract Fermented by Lactobacillus plantarum BL2 in Diet-Induced Obese Mice.' | ||
const received = highlightByQuery(query, content, options) | ||
const expected = 'Antiobesity Effect of Garlic Extract Fermented by Lactobacillus plantarum <span id=\"highlight-0\" class=\"extra-bold\">BL2</span> in Diet-Induced Obese Mice.' | ||
const expected = | ||
'Antiobesity Effect of Garlic Extract Fermented by Lactobacillus plantarum <span id="highlight-0" class="extra-bold">BL2</span> in Diet-Induced Obese Mice.' | ||
expect(received).toBe(expected) | ||
@@ -419,5 +473,7 @@ }) | ||
const query = '"blood" "cancer"' | ||
const content = 'Appraisal of Metal Imbalances in the Blood of Thyroid Cancer Patients in Comparison with Healthy Subjects.' | ||
const content = | ||
'Appraisal of Metal Imbalances in the Blood of Thyroid Cancer Patients in Comparison with Healthy Subjects.' | ||
const received = highlightByQuery(query, content, options) | ||
const expected = 'Appraisal of Metal Imbalances in the <span id=\"highlight-0\" class=\"extra-bold\">Blood</span> of Thyroid <span id=\"highlight-1\" class=\"extra-bold\">Cancer</span> Patients in Comparison with Healthy Subjects.' | ||
const expected = | ||
'Appraisal of Metal Imbalances in the <span id="highlight-0" class="extra-bold">Blood</span> of Thyroid <span id="highlight-1" class="extra-bold">Cancer</span> Patients in Comparison with Healthy Subjects.' | ||
expect(received).toBe(expected) | ||
@@ -428,5 +484,7 @@ }) | ||
const query = 'blood on the had' | ||
const content = 'No viremia of pandemic (H1N1) 2009 was demonstrated in blood donors who had donated blood during the probable incubation period.' | ||
const content = | ||
'No viremia of pandemic (H1N1) 2009 was demonstrated in blood donors who had donated blood during the probable incubation period.' | ||
const received = highlightByQuery(query, content, options) | ||
const expected = 'No viremia of pandemic (H1N1) 2009 was demonstrated in <span id=\"highlight-0\" class=\"extra-bold\">blood</span> donors who <span id=\"highlight-2\" class=\"extra-bold\">had</span> donated <span id=\"highlight-1\" class=\"extra-bold\">blood</span> during the probable incubation period.' | ||
const expected = | ||
'No viremia of pandemic (H1N1) 2009 was demonstrated in <span id="highlight-0" class="extra-bold">blood</span> donors who <span id="highlight-2" class="extra-bold">had</span> donated <span id="highlight-1" class="extra-bold">blood</span> during the probable incubation period.' | ||
expect(received).toBe(expected) | ||
@@ -437,5 +495,7 @@ }) | ||
const query = '(cancer NOT blood)' | ||
const content = 'Supramolecular self-assembly of a hybrid \'hyalurosome\' for targeted photothermal therapy in non-small cell lung cancer.' | ||
const content = | ||
"Supramolecular self-assembly of a hybrid 'hyalurosome' for targeted photothermal therapy in non-small cell lung cancer." | ||
const received = highlightByQuery(query, content, options) | ||
const expected = 'Supramolecular self-assembly of a hybrid \'hyalurosome\' for targeted photothermal therapy in non-small cell lung <span id=\"highlight-0\" class=\"extra-bold\">cancer</span>.' | ||
const expected = | ||
'Supramolecular self-assembly of a hybrid \'hyalurosome\' for targeted photothermal therapy in non-small cell lung <span id="highlight-0" class="extra-bold">cancer</span>.' | ||
expect(received).toBe(expected) | ||
@@ -446,5 +506,7 @@ }) | ||
const query = 'TITLE:"blood in"' | ||
const content = 'Strawberry milk-like blood in a subject with diabetic lipemia: dramatic change to transparent color after insulin therapy.' | ||
const content = | ||
'Strawberry milk-like blood in a subject with diabetic lipemia: dramatic change to transparent color after insulin therapy.' | ||
const received = highlightByQuery(query, content, options) | ||
const expected = 'Strawberry milk-like <span id=\"highlight-0\" class=\"extra-bold\">blood in</span> a subject with diabetic lipemia: dramatic change to transparent color after insulin therapy.' | ||
const expected = | ||
'Strawberry milk-like <span id="highlight-0" class="extra-bold">blood in</span> a subject with diabetic lipemia: dramatic change to transparent color after insulin therapy.' | ||
expect(received).toBe(expected) | ||
@@ -455,5 +517,7 @@ }) | ||
// const query = 'TITLE:blood AND CONTENT:cell' | ||
// const content = 'A molecular map of lymph node blood vascular endothelium at single cell resolution' | ||
// const content = | ||
// 'A molecular map of lymph node blood vascular endothelium at single cell resolution' | ||
// const received = highlightByQuery(query, content, { validFields: ['TITLE'] }) | ||
// const expected = 'A molecular map of lymph node <span id=\"highlight-0\" class=\"extra-bold\">blood</span> vascular endothelium at single cell resolution' | ||
// const expected = | ||
// 'A molecular map of lymph node <span id="highlight-0" class="extra-bold">blood</span> vascular endothelium at single cell resolution' | ||
// expect(received).toBe(expected) | ||
@@ -464,6 +528,11 @@ // }) | ||
const query = 'TITLE:blood OR CONTENT:cell' | ||
const content = 'A molecular map of lymph node blood vascular endothelium at single cell resolution' | ||
const received = highlightByQuery(query, content, { validFields: ['TITLE', 'CONTENT'], highlightedFields: ['CONTENT'] }) | ||
const expected = 'A molecular map of lymph node blood vascular endothelium at single <span id="highlight-0" class="extra-bold">cell</span> resolution' | ||
const content = | ||
'A molecular map of lymph node blood vascular endothelium at single cell resolution' | ||
const received = highlightByQuery(query, content, { | ||
validFields: ['TITLE', 'CONTENT'], | ||
highlightedFields: ['CONTENT'] | ||
}) | ||
const expected = | ||
'A molecular map of lymph node blood vascular endothelium at single <span id="highlight-0" class="extra-bold">cell</span> resolution' | ||
expect(received).toBe(expected) | ||
}) |
{ | ||
"name": "js-solr-highlighter", | ||
"version": "0.6.5", | ||
"version": "0.6.6", | ||
"description": "A JavaScript library for highlighting HTML text based on the query in the lucene/solr query syntax", | ||
@@ -8,3 +8,3 @@ "main": "build/index.js", | ||
"build": "babel index.js -d build", | ||
"lint": "./node_modules/.bin/eslint index.js --fix", | ||
"lint": "./node_modules/.bin/eslint index.js index.test.js --fix", | ||
"lint:nofix": "./node_modules/.bin/eslint index.js --max-warnings 0", | ||
@@ -11,0 +11,0 @@ "test": "jest" |
@@ -5,3 +5,3 @@ # js-solr-highlighter | ||
### no options | ||
```bash | ||
```javascript | ||
var query = 'cancer AND blood' | ||
@@ -13,3 +13,3 @@ var content = 'Platelet Volume Is Reduced In Metastasing Breast Cancer: Blood Profiles Reveal Significant Shifts.' | ||
### with the validFields options that specify the fields valid in the query syntax. If not specified, all like X:X will be valid fields | ||
```bash | ||
```javascript | ||
var query = 'TITLE:blood AND CONTENT:cell' | ||
@@ -23,3 +23,3 @@ var content = 'A molecular map of lymph node blood vascular endothelium at single cell resolution' | ||
### with the highlightedFields options that specify the valid fields whose values will be highlighted. If not specified, the values of all valid fields will be highlighted | ||
```bash | ||
```javascript | ||
var query = 'TITLE:blood OR CONTENT:cell' | ||
@@ -26,0 +26,0 @@ var content = 'A molecular map of lymph node blood vascular endothelium at single cell resolution' |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37240
814