only_ever_generator 0.7.7 → 0.7.8
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.
|
@@ -81,36 +81,13 @@ class ParseCardResponse {
|
|
|
81
81
|
const cardFacts = (_b = generatedCardData.facts) !== null && _b !== void 0 ? _b : [];
|
|
82
82
|
const combinedCardFactsAndConcepts = [...cardConcepts, ...cardFacts];
|
|
83
83
|
const sourceConcepts = (_c = sourceTaxonomy.concepts) !== null && _c !== void 0 ? _c : [];
|
|
84
|
-
// const sourceFacts = sourceTaxonomy.facts ?? [];
|
|
85
84
|
const mappedSourceConcepts = sourceConcepts.map((elem) => {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
reference: elem.reference,
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
return {
|
|
96
|
-
text: elem.concept_text,
|
|
97
|
-
reference: elem.reference,
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
const mappedSourceFacts = sourceConcepts.map((elem) => {
|
|
102
|
-
if (elem.type == "fact") {
|
|
103
|
-
return {
|
|
104
|
-
text: elem.concept_text,
|
|
105
|
-
reference: elem.reference,
|
|
106
|
-
};
|
|
107
|
-
}
|
|
85
|
+
return {
|
|
86
|
+
text: elem.concept_text,
|
|
87
|
+
reference: elem.reference,
|
|
88
|
+
};
|
|
108
89
|
});
|
|
109
|
-
const
|
|
110
|
-
...mappedSourceConcepts,
|
|
111
|
-
...mappedSourceFacts,
|
|
112
|
-
];
|
|
113
|
-
const firstMatchedConcept = compinedConceptsAndFacts.find((elem) => combinedCardFactsAndConcepts.includes(elem.text));
|
|
90
|
+
const firstMatchedConcept = sourceConcepts.find((elem) => combinedCardFactsAndConcepts.includes(elem.text));
|
|
114
91
|
if (firstMatchedConcept) {
|
|
115
92
|
return firstMatchedConcept.reference;
|
|
116
93
|
}
|
package/package.json
CHANGED
|
@@ -85,38 +85,15 @@ export class ParseCardResponse {
|
|
|
85
85
|
const combinedCardFactsAndConcepts = [...cardConcepts, ...cardFacts];
|
|
86
86
|
|
|
87
87
|
const sourceConcepts = sourceTaxonomy.concepts ?? [];
|
|
88
|
-
// const sourceFacts = sourceTaxonomy.facts ?? [];
|
|
89
88
|
|
|
90
89
|
const mappedSourceConcepts = sourceConcepts.map((elem: any) => {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
reference: elem.reference,
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
} else {
|
|
99
|
-
return {
|
|
100
|
-
text: elem.concept_text,
|
|
101
|
-
reference: elem.reference,
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
const mappedSourceFacts = sourceConcepts.map((elem: any) => {
|
|
106
|
-
if (elem.type == "fact") {
|
|
107
|
-
return {
|
|
108
|
-
text: elem.concept_text,
|
|
109
|
-
reference: elem.reference,
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
}
|
|
90
|
+
return {
|
|
91
|
+
text: elem.concept_text,
|
|
92
|
+
reference: elem.reference,
|
|
93
|
+
};
|
|
113
94
|
});
|
|
114
95
|
|
|
115
|
-
const
|
|
116
|
-
...mappedSourceConcepts,
|
|
117
|
-
...mappedSourceFacts,
|
|
118
|
-
];
|
|
119
|
-
const firstMatchedConcept = compinedConceptsAndFacts.find((elem: any) =>
|
|
96
|
+
const firstMatchedConcept = sourceConcepts.find((elem: any) =>
|
|
120
97
|
combinedCardFactsAndConcepts.includes(elem.text)
|
|
121
98
|
);
|
|
122
99
|
|