only_ever_generator 0.7.5 → 0.7.7
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.
|
@@ -76,23 +76,35 @@ class ParseCardResponse {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
_getCardReference(generatedCardData, sourceTaxonomy) {
|
|
79
|
-
var _a, _b, _c
|
|
79
|
+
var _a, _b, _c;
|
|
80
80
|
const cardConcepts = (_a = generatedCardData.concepts) !== null && _a !== void 0 ? _a : [];
|
|
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 =
|
|
84
|
+
// const sourceFacts = sourceTaxonomy.facts ?? [];
|
|
85
85
|
const mappedSourceConcepts = sourceConcepts.map((elem) => {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
86
|
+
if (elem.type) {
|
|
87
|
+
if (elem.type == "concept") {
|
|
88
|
+
return {
|
|
89
|
+
text: elem.concept_text,
|
|
90
|
+
reference: elem.reference,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
return {
|
|
96
|
+
text: elem.concept_text,
|
|
97
|
+
reference: elem.reference,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
90
100
|
});
|
|
91
|
-
const mappedSourceFacts =
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
101
|
+
const mappedSourceFacts = sourceConcepts.map((elem) => {
|
|
102
|
+
if (elem.type == "fact") {
|
|
103
|
+
return {
|
|
104
|
+
text: elem.concept_text,
|
|
105
|
+
reference: elem.reference,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
96
108
|
});
|
|
97
109
|
const compinedConceptsAndFacts = [
|
|
98
110
|
...mappedSourceConcepts,
|
package/package.json
CHANGED
|
@@ -85,19 +85,31 @@ export class ParseCardResponse {
|
|
|
85
85
|
const combinedCardFactsAndConcepts = [...cardConcepts, ...cardFacts];
|
|
86
86
|
|
|
87
87
|
const sourceConcepts = sourceTaxonomy.concepts ?? [];
|
|
88
|
-
const sourceFacts = sourceTaxonomy.facts ?? [];
|
|
88
|
+
// const sourceFacts = sourceTaxonomy.facts ?? [];
|
|
89
89
|
|
|
90
90
|
const mappedSourceConcepts = sourceConcepts.map((elem: any) => {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
if (elem.type) {
|
|
92
|
+
if (elem.type == "concept") {
|
|
93
|
+
return {
|
|
94
|
+
text: elem.concept_text,
|
|
95
|
+
reference: elem.reference,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
} else {
|
|
99
|
+
return {
|
|
100
|
+
text: elem.concept_text,
|
|
101
|
+
reference: elem.reference,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
95
104
|
});
|
|
96
|
-
const mappedSourceFacts =
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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
|
+
}
|
|
101
113
|
});
|
|
102
114
|
|
|
103
115
|
const compinedConceptsAndFacts = [
|