还有一个,就是如果一个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.*