We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://github.com/lxfater/BilibiliSummary/blob/3d1a67cbe8e96adba60672b778ce89644a43280d/src/prompt.ts#L84C95-L84C95 这行代码有个地方没想通,这段代码我的理解是将旧字幕项添加到结果中,但同时需要确保总字节长度不超过限制。如果添加旧字幕项会导致超出限制,则只添加该字幕项的一部分;如果不会超出限制,则完整添加该字幕项。 比如我们假设以下参数: lastByteLength: 1000 nextTextByteLength: 300 byteLimit: 1000 也就是说这时候文本正好达到限制长度,应该不截取任何长度到resultData中 但实际计算确是 计算超出的字节数: 1000+300−1000=300 计算超出比率: overRate=300/300=1 const chunkedText = obj.text.substring(0, Math.floor(obj.text.length * overRate)); 这不就变成了把这一段文本都放到resultdata中吗 不知道是否是哪里理解错了
The text was updated successfully, but these errors were encountered:
为什么不用让chatgpt解答你的问题呢?
Sorry, something went wrong.
已经问过chatgpt说有问题,才在这里问的,
以上是我和chatgpt的完整对话
No branches or pull requests
https://github.com/lxfater/BilibiliSummary/blob/3d1a67cbe8e96adba60672b778ce89644a43280d/src/prompt.ts#L84C95-L84C95
这行代码有个地方没想通,这段代码我的理解是将旧字幕项添加到结果中,但同时需要确保总字节长度不超过限制。如果添加旧字幕项会导致超出限制,则只添加该字幕项的一部分;如果不会超出限制,则完整添加该字幕项。
比如我们假设以下参数:
lastByteLength: 1000
nextTextByteLength: 300
byteLimit: 1000
也就是说这时候文本正好达到限制长度,应该不截取任何长度到resultData中
但实际计算确是
计算超出的字节数:
1000+300−1000=300
计算超出比率:
overRate=300/300=1
const chunkedText = obj.text.substring(0, Math.floor(obj.text.length * overRate));
这不就变成了把这一段文本都放到resultdata中吗
不知道是否是哪里理解错了
The text was updated successfully, but these errors were encountered: