网站可能被墙,请记住以下域名:subhd.cc subhd.me
求Honor Society中文字幕 imdb:16491324
Y
yanshao
2022年8月8日 15:38

求Honor Society中文字幕 imdb:16491324
发表留言 共 0 条

最新评论
本质是用二分法递归解决。 有点好玩的是,可以直接问UI,它应该对应哪个位置。judgeTranslationIndex()里的提示词:以下是一段对话:\n" + originalTextAll + "\n" +"其中的 "\"" + originalText + "\"对应的翻译,最接近、最相关的是哪个:\n" + zhTextAll + "\n请直接给出结果的序号,不需要解释"; 看代码: * 给源文本的字符串队列,找到对应的中文索引 * * @param batch 全量的字幕块列表 * @param orgStart 源文本的开始位置 * @param orgEnd 源文本的结束位置 * @param zhTextList 全量的中文文本列表 * @param zhStart 中文的开始位置 * @param zhEnd 中文的结束位置 */ private void mapFromEn2Zh(List batch, int orgStart, int orgEnd, List zhTextList, int zhStart, int zhEnd) { // 用二分法定位源文的列表中间元素,对应的中文位置 int mid = orgStart + (orgEnd - orgStart) / 2; List seekStrings = zhTextList.subList(searchChsStart, searchChsEnd + 1); // subList() 是左闭右开,即左边包含,右边不包含 int pos = geminiTransApiService.judgeTranslationIndex(null, batch.get(mid).getText(), seekStrings); log.info("[{}] {} -> {}", batch.get(mid).getIndex(), batch.get(mid).getText(), zhTextList.get(pos)); log.info("en[{}] -> zh[{}]", mid, pos); // 把中文翻译附加到对应的字幕块上 attachChsText(batch.get(mid), zhTextList.get(pos)); mapFromEn2Zh(batch, orgStart, mid - 1, zhTextList, zhStart, pos - 1); mapFromEn2Zh(batch, mid + 1, orgEnd, zhTextList, pos + 1, zhEnd); } - gyjian
SubHD 0.008