@3-/aiapi 0.1.21 → 0.1.23
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/factCheck.js +6 -6
- package/package.json +1 -1
package/factCheck.js
CHANGED
|
@@ -98,17 +98,17 @@ txtLi = (txt) => {
|
|
|
98
98
|
var all_tag, i, id, pre, r, reset, t, tag, trim, txt_li;
|
|
99
99
|
r = [];
|
|
100
100
|
reset = () => {
|
|
101
|
-
|
|
101
|
+
all_tag = new Set(['标题', '观点', '事实', '失实度']);
|
|
102
|
+
if (t) {
|
|
103
|
+
r.push(t);
|
|
104
|
+
}
|
|
102
105
|
pre = t = void 0;
|
|
103
106
|
};
|
|
104
107
|
txt_li = txt.replaceAll('**', '').split('\n');
|
|
105
|
-
all_tag = new Set(['标题', '观点', '事实', '失实度']);
|
|
106
108
|
out: //;
|
|
107
109
|
for (i of txt_li) {
|
|
108
110
|
if (i.startsWith('- id:')) {
|
|
109
|
-
|
|
110
|
-
reset();
|
|
111
|
-
}
|
|
111
|
+
reset();
|
|
112
112
|
id = parseInt(i.slice(5).trim());
|
|
113
113
|
if (id) {
|
|
114
114
|
t = {id};
|
|
@@ -126,7 +126,7 @@ txtLi = (txt) => {
|
|
|
126
126
|
continue out;
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
-
if (pre) {
|
|
129
|
+
if (pre && trim) {
|
|
130
130
|
t[pre] += '\n' + trim;
|
|
131
131
|
}
|
|
132
132
|
}
|