Open systemoutprintlnhelloworld opened 1 month ago
由于我精力有限,无法顾及所有细节的功能请求,欢迎PR
谢谢回复,非常理解
compromise
包实现断句:const nlp = require("compromise");
const text = "Hello world. This is a test. TypeScript is awesome!";
const doc = nlp(text);
const sentences = doc.sentences().out('array');
但是在Zotero环境下好像无法运行
不需要太复杂,翻译出来即可。本来机器翻译准确度也不是很高
Is there an existing issue for this?
Environment
Describe the feature request
Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 众所周知,CNKI 最新的句子翻译对非会员进行了字数限制,前面也有issue
196 提到分段翻译来突破这个限制,但是似乎作者没有注意到或者有其他考量,但是由于cnki的翻译确实质量较高,本人也有较高的需求,所以这里重新开了一个issue讨论这个需求.
Why do you need this feature? A clear and concise description of why you need this feature. cnki的翻译确实质量较高,本人也有较高的需求
Describe the solution you'd like
The solution you'd like A clear and concise description of what you want to happen. 由于并不是所有人都需要这个功能,并且按照句号进行分段也许并不能完美分割意群,所以这个功能最好设置为一个可选项
单次翻译上限
初步分段
为句子单词数
/单次翻译上限
段初步分段
中最后一个句号的位置,将这个句号之后的单词移动到下一个初部分段
中初步分段
中单词数再次超过单次翻译上限
,再次确定分段中倒数第二个句子位置,进行同第三步
的移动初步分段
已经低于单次翻译上限
规定的单词数,再对下一个初步分段进行检查
,不满足则反复进行 3&4 步,注意最后一个初步分段
多余的句子请新创建一个分段进行填充,检查后超出'单次翻译上限`则继续添加此外,本方案中的句号如果不足,可以按照以下优先级进行分段判断
句号>>逗号>>空格 >>选择最后一个单词
需要注意的是,该方案还有很多不足,如:
Alternatives you've considered A clear and concise description of any alternative solutions or features you've considered. 设置一个提醒弹窗,超过
单次翻译上限
则不予翻译,或者在翻译栏无声提醒Anything else?
No response