- 主题:真的要失业了,用ai+python写了一个界面
还有一个,就是如果一个lib的文档极度缺乏,但能拿到源码时,ai编程真是无敌啊。
我最近无聊,在看一个叫libpinyin的输入法库,这个文档极度缺乏。我给需求,给AI提供libpinyin的源码路径,让它写代码,debug时候结合源码分析。
真是无敌,迭代极快。
一下午就能基于一个自己完全不熟悉的库,写出健壮的代码。
● Perfect! So the syllable count does match (16 syllables for 16 characters). The problem is the phrase length limit: phrase_length >= MAX_PHRASE_LENGTH
where MAX_PHRASE_LENGTH = 16.
Root Cause:
libpinyin has a hard-coded limit: phrases must be < 16 characters.
The check in pinyin_iterator_add_phrase:
if (0 == phrase_length || phrase_length >= MAX_PHRASE_LENGTH)
return result; // Returns false
Since the phrase has exactly 16 characters, it fails the check.
Solution:
Update the error message to inform users about this limitation:
--
FROM 64.207.220.*
写完甚至可以让它再来个高强度测试。
让它自己生成testcase,自己测试并分析结果。
Overall: 191/200 PASSED (95.5%) ?
┌──────────────────┬───────┬───────────┬────────────────────┐
│ Category │ Tests │ Pass Rate │ Notes │
├──────────────────┼───────┼───────────┼────────────────────┤
│ Basic phrases │ 50 │ 94% │ 3 homophone issues │
├──────────────────┼───────┼───────────┼────────────────────┤
│ With prefix │ 50 │ 96% │ 2 homophone issues │
├──────────────────┼───────┼───────────┼────────────────────┤
│ Long phrases │ 20 │ 90% │ 2 compound issues │
├──────────────────┼───────┼───────────┼────────────────────┤
│ Repeated inputs │ 30 │ 100% │ ? Learning works! │
├──────────────────┼───────┼───────────┼────────────────────┤
│ Edge cases │ 20 │ 100% │ ? Robust! │
├──────────────────┼───────┼───────────┼────────────────────┤
│ Mixed complexity │ 30 │ 93% │ 2 homophone issues │
└──────────────────┴───────┴───────────┴────────────────────┘
? Key Findings
? Excellent Stability
- Zero crashes in 200 tests
- Zero timeouts
- Zero errors
- Clean execution
? Learning Works
- 100% pass rate on repeated inputs
- User preferences are remembered
- Persistent storage working correctly
? Expected Limitations
- 9 failures all due to Chinese homophone ambiguity
- Examples: 很/恨, 去/区, 是/市 (same pinyin)
- This is a linguistic issue, not a software bug
- Users can select correct candidate when first choice is wrong
【 在 allegro 的大作中提到: 】
: 还有一个,就是如果一个lib的文档极度缺乏,但能拿到源码时,ai编程真是无敌啊。
: 我最近无聊,在看一个叫libpinyin的输入法库,这个文档极度缺乏。我给需求,给AI提供libpinyin的源码路径,让它写代码,debug时候结合源码分析。
: 真是无敌,迭代极快。
: ...................
--
FROM 64.207.220.*
这种轻量级的应用以后都是AI的天下。深思考,深度逻辑,大框架的才需要人。
--
FROM 222.128.5.*