deep-read-summarize 0.6.5 → 0.6.6
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/CHANGELOG.md +13 -0
- package/docs/RELEASE.md +2 -1
- package/lib/quality.js +22 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [0.6.6] — 2026-11-19
|
|
9
|
+
|
|
10
|
+
修复关键引用核验把 Markdown 引用块里的署名误算为引文的问题。
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- 第 4 节的引文后可以在同一引用块内另起一行写署名和位置,例如 `> ——作者,原文第 2 行`。署名保留在笔记里,两种排版使用相同的引文核验记录。
|
|
15
|
+
- 回归测试覆盖块内外署名、同一块里的多行无引号原文,以及缺少记录和摘录不匹配时的核验失败。插件工具测试也验证了宿主按实际源文件核对引文。
|
|
16
|
+
|
|
17
|
+
### 贡献者与致谢
|
|
18
|
+
|
|
19
|
+
- 感谢 @qneko 报告问题,提供可独立运行的复现脚本和两种排版的对照结果。[Issue #12](https://github.com/PensiveFei/deep-read-summarize/issues/12)
|
|
20
|
+
|
|
8
21
|
## [0.6.5] — 2026-11-17
|
|
9
22
|
|
|
10
23
|
区分来源是否完整,在宿主侧核对原文引句,并提供可复现的精读质量基准。
|
package/docs/RELEASE.md
CHANGED
|
@@ -160,7 +160,8 @@ npm view deep-read-summarize --prefer-online # 验证线
|
|
|
160
160
|
| v0.6.2 | npm 已发布 | 修复成稿包含前言或外层 Markdown 围栏时,笔记被误判为格式、篇幅和引用不合格的问题。 |
|
|
161
161
|
| v0.6.3 | npm 已发布 | 修复获取阶段把「子代理没有返回结构化结果」误报成内容获取失败的问题,并让获取提示词的 JSON 示例合法、可被结构化输出接受。 |
|
|
162
162
|
| v0.6.4 | npm 已发布 | 让未通过核验的笔记保留清晰状态与原因,并支持直接请求简洁精读笔记。 |
|
|
163
|
-
|
|
|
163
|
+
| v0.6.5 | npm 已发布 | 区分来源状态、由宿主核对逐字引文,并提供质量基准。 |
|
|
164
|
+
| **v0.6.6** | **npm 已发布(当前)** | 修复关键引用核验把 Markdown 引用块里的署名误算为引文的问题。 |
|
|
164
165
|
| v1.0.0 | 计划 | API 稳定后发布 |
|
|
165
166
|
|
|
166
167
|
> 早期迭代用 0.x 表达不稳定;API 稳定后再发 1.0.0。
|
package/lib/quality.js
CHANGED
|
@@ -181,7 +181,19 @@ function checkNoteStructure(note, options) {
|
|
|
181
181
|
if (/^##[ \t]/.test(line)) break;
|
|
182
182
|
quoteLines.push(line);
|
|
183
183
|
}
|
|
184
|
+
const locator = /(?:(?:原文[ \t]*)?第[ \t]*\d+[ \t]*(?:[-–][ \t]*\d+[ \t]*)?(?:行|页|章|节|段)|(?:lines?|pages?|chapter|section)[ \t]+\d+(?:[ \t]*[-–][ \t]*\d+)?|\d{1,2}:\d{2}(?::\d{2})?(?:\.\d+)?)/;
|
|
185
|
+
const parentheticalLocator = new RegExp('[ \\t]*[((]' + locator.source + '[))]$', 'i');
|
|
186
|
+
const signature = /^(?:—{1,2}|–|--)[ \t]*[\p{L}\p{M}\p{N}]+(?:[ \t.'’·-]+[\p{L}\p{M}\p{N}]+)*$/u;
|
|
187
|
+
const creditLocator = new RegExp('[,,][ \\t]*' + locator.source + '$', 'i');
|
|
188
|
+
let blockHasQuote = false;
|
|
189
|
+
function recordQuote(quote, inBlockquote) {
|
|
190
|
+
if (!quote) return;
|
|
191
|
+
if (inBlockquote) blockHasQuote = true;
|
|
192
|
+
if (!quotes.includes(quote)) quotes.push(quote);
|
|
193
|
+
}
|
|
184
194
|
for (const line of quoteLines) {
|
|
195
|
+
const inBlockquote = line.startsWith('>');
|
|
196
|
+
if (!inBlockquote) blockHasQuote = false;
|
|
185
197
|
// A blockquote can contain a quoted sentence followed by its location.
|
|
186
198
|
// Prefer the explicit sentence so Markdown markers and locations do not become source text.
|
|
187
199
|
const expression = /“([^”\n]+)”|「([^」\n]+)」|"([^"\n]+)"/g;
|
|
@@ -189,14 +201,20 @@ function checkNoteStructure(note, options) {
|
|
|
189
201
|
while ((match = expression.exec(line))) {
|
|
190
202
|
explicit = true;
|
|
191
203
|
const quote = inlineText(match[1] || match[2] || match[3]).trim();
|
|
192
|
-
|
|
204
|
+
recordQuote(quote, inBlockquote);
|
|
193
205
|
}
|
|
194
206
|
if (!explicit && /^>[ \t]+/.test(line)) {
|
|
195
207
|
// A trailing, explicitly labelled locator belongs to the citation,
|
|
196
208
|
// not to the sentence. Do not remove arbitrary parenthetical prose.
|
|
197
|
-
const
|
|
198
|
-
|
|
199
|
-
|
|
209
|
+
const content = inlineText(line.replace(/^(?:>[ \t]*)+/, '')).trim();
|
|
210
|
+
if (blockHasQuote) {
|
|
211
|
+
// A signed name and a comma-delimited locator credit the preceding quote.
|
|
212
|
+
// A dash-led sentence can carry its own parenthesized locator.
|
|
213
|
+
const location = content.match(creditLocator);
|
|
214
|
+
if (location && signature.test(content.slice(0, location.index).trimEnd())) continue;
|
|
215
|
+
}
|
|
216
|
+
const quote = content.replace(parentheticalLocator, '').trimEnd();
|
|
217
|
+
recordQuote(quote, true);
|
|
200
218
|
}
|
|
201
219
|
}
|
|
202
220
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "deep-read-summarize",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.6",
|
|
4
4
|
"description": "DSH 精读插件:书籍精读、论文精读、视频总结、网页摘要 → 结构化 Markdown 读书笔记(YAML frontmatter,可放进 Obsidian / Logseq)。English: deep reading & summarization for DSH — books, papers, videos and web pages into structured Markdown notes.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "index.js",
|