@yottameta/yotta-humanize 0.2.0 → 0.2.1
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 +5 -0
- package/SKILL.md +1 -1
- package/package.json +1 -1
- package/scripts/test_yotta_humanize.py +16 -0
- package/scripts/yotta_humanize.py +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
## v0.2.1 (2026-09-19)
|
|
2
|
+
|
|
3
|
+
- 修复:`score` / `analyze` / `report` / `suggest` / `rewrite` 以位置参数直接传文本时报 `expected string or bytes-like object, got 'list'`(`_read_text` 把文本列表原样返回,未拼接);`-f` / `--stdin` 路径不受影响。
|
|
4
|
+
- 补回归测试:位置参数单文本 / 多词拼接共 3 项(修复前复现红,修复后全量 158/158 通过)。
|
|
5
|
+
|
|
1
6
|
## v0.2.0 (2026-09-09)
|
|
2
7
|
|
|
3
8
|
- 评测完善批 2:FAQ 补速查索引、触发说明与安装排障;新增 references/walkthroughs.md(公众号/正式纪要/批量门禁三类复杂走查)。
|
package/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: yotta-humanize
|
|
3
|
-
version: 0.2.
|
|
3
|
+
version: 0.2.1
|
|
4
4
|
description: 元真 —— 去 AI 味的中文写作编辑技能:检测器引擎(24 类规则 + 词表 + 统计突发性)识别并改写 AI 腔文本,让中文写作更自然、更像人写的。触发:编辑 / 润色文本、去 AI 味、让文章 / 文案 / 回复更像人写、发现文本充斥着 AI 常用词与句式(赋能 / 闭环 / 值得注意的是 / 综上所述 / 希望对你有所帮助 等)、给 AI 生成的中文稿件做检测与改写。边界:只处理文本,不生成新内容;不改写事实 / 数据 / 专有名词;不破坏作者原意;改写为确定性规则,不依赖模型。
|
|
5
5
|
license: MIT
|
|
6
6
|
---
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yottameta/yotta-humanize",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Yuanzhen (元真) — AI-flavor remover for Chinese writing: a detector engine (24 rule classes + wordlists + statistical burstiness) that identifies and rewrites AI-typical Chinese text to make it read more naturally. Triggers when editing/polishing text, removing AI flavor, or making copy read more human. Boundaries: text-only, deterministic rewrites, no model dependency.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -178,6 +178,22 @@ def test_cli():
|
|
|
178
178
|
check("score 文本输出为数字", r.returncode == 0 and r.stdout.strip().isdigit(),
|
|
179
179
|
"rc=%d out=%r" % (r.returncode, r.stdout))
|
|
180
180
|
|
|
181
|
+
# 位置参数直接传文本(v0.2.1 回归:_read_text 曾把 args.text 列表原样返回)
|
|
182
|
+
r = _run(["score", ai])
|
|
183
|
+
check("score 位置参数直接传文本",
|
|
184
|
+
r.returncode == 0 and r.stdout.strip().isdigit(),
|
|
185
|
+
"rc=%d out=%r err=%r" % (r.returncode, r.stdout[:60], r.stderr[:80]))
|
|
186
|
+
|
|
187
|
+
r = _run(["rewrite", ai])
|
|
188
|
+
check("rewrite 位置参数直接传文本",
|
|
189
|
+
r.returncode == 0 and "改写后评分" in r.stdout,
|
|
190
|
+
"rc=%d err=%r" % (r.returncode, r.stderr[:80]))
|
|
191
|
+
|
|
192
|
+
r = _run(["score", "众所周知,", "未来可期。"])
|
|
193
|
+
check("score 多词位置参数按空格拼接",
|
|
194
|
+
r.returncode == 0 and r.stdout.strip().isdigit(),
|
|
195
|
+
"rc=%d out=%r err=%r" % (r.returncode, r.stdout[:60], r.stderr[:80]))
|
|
196
|
+
|
|
181
197
|
r = _run(["score", "--gate", "--threshold", "1"], inp=ai)
|
|
182
198
|
check("score --gate 高分退出码 1", r.returncode == 1, "rc=%d" % r.returncode)
|
|
183
199
|
|
|
@@ -47,7 +47,7 @@ _HERE = Path(__file__).resolve().parent
|
|
|
47
47
|
sys.path.insert(0, str(_HERE))
|
|
48
48
|
import humanize_rules as HR # noqa: E402
|
|
49
49
|
|
|
50
|
-
VERSION = "0.2.
|
|
50
|
+
VERSION = "0.2.1"
|
|
51
51
|
TOOL_NAME = "yotta-humanize"
|
|
52
52
|
TOOL_CN = "元真"
|
|
53
53
|
DEFAULT_THRESHOLD = 45
|
|
@@ -525,7 +525,7 @@ def _read_text(args):
|
|
|
525
525
|
if getattr(args, "stdin", False):
|
|
526
526
|
return _read_stdin()
|
|
527
527
|
if getattr(args, "text", None):
|
|
528
|
-
return args.text
|
|
528
|
+
return " ".join(args.text)
|
|
529
529
|
if not sys.stdin.isatty():
|
|
530
530
|
return _read_stdin()
|
|
531
531
|
raise SystemExit("缺少输入:用 -f 指定文件、--stdin 读管道,或直接传文本参数。")
|