Comments (18)
from potplayer_subtitle_translate_baidu.
您好,我现在有了新的解决方案,我在有翻译的字幕中都添加了"《 B R 》"(换行符),所以现在剩下的问题就是进行一个判断,在text(原文)中寻找"《BR》",如果找到返回1否则返回负数,我阅读了angelscript的开发者文档,但是仍不会编写,报函数错误(太菜了),请问该如何编写呢?谢谢!(用中文 《 的原因是github会把《BR》识别成换行符)
from potplayer_subtitle_translate_baidu.
字符串是 potplaty 自己封装的
并不确定它提供了啥方法。。
不过字符串本质是连续一串字符串长度+\0结尾的内存。
所以
//字符串[索引偏移] == 目标字符
string strTest = "abcdefg";
//strTest[0] == "a"[0]
//strTest[2] == "c"[0]
有必要的话,完全可以自己封装一个 strstr 的函数实现你的功能
from potplayer_subtitle_translate_baidu.
好的,我自己在里面添加了几行代码,添加在了Translate的函数下面,编译通过了,但是没有实现相应的功能,能请您帮忙看看吗?谢谢!
string strTest="
";
for(int i = 0;i < srcLang.length();i++){
if(text[i] == strTest[0]){
if(text[i+1] == strTest[1]){
if(text[i+2] == strTest[2]){
ret = " ";
}
else{ }
}
else{ }
}
else{ }
}
from potplayer_subtitle_translate_baidu.
from potplayer_subtitle_translate_baidu.
而且要查找的字符不应该是不是四个?才3
个if不够吧
from potplayer_subtitle_translate_baidu.
好的,我明白了,我已经在c的编译器里测试过新改的代码了,但是在脚本里,一直报这个错误
我觉得是没有包含头文件造成的,但是,头文件写在哪林,哪里就报错'Unexpected token ''
请问如何修改呢?谢谢!
from potplayer_subtitle_translate_baidu.
char b[4]="
";
int i;
for(i = 0;i < srcLang.length();i++){
if(text[i] == b[0]){
if(text[i+1] == b[1]){
if(text[i+2] == b[2]){
if(text[i+3] == b[3]){
ret = " ";
break;
}
}
}
}
}
这是修改后的代码,ret返回空值是因为您下面标注了这句话的作用
所以才这样子用的,谢谢!
from potplayer_subtitle_translate_baidu.
from potplayer_subtitle_translate_baidu.
截图没提到的报错信息,唯有分号,b变量重复定义的错误
不建议c在vs里面写,因为不使用include编译指令,一些内置c函数vs能跑,potplayer不能跑。
from potplayer_subtitle_translate_baidu.
嗯嗯。。发现了。。但是b没有重复定义,也没少 ; 。我换了一个变量,也是报同样的错误,只有第一版是没有任何报错的。。
from potplayer_subtitle_translate_baidu.
我看您上面用string定义字符串,但是我没有用过,之前是复制过来改的,所以也不知道具体的作用。。
from potplayer_subtitle_translate_baidu.
from potplayer_subtitle_translate_baidu.
from potplayer_subtitle_translate_baidu.
我这样修改了一下,不报错了,但是功能还是没有实现。。还是会再翻译一遍
string Translatetest1="
";
int i;
for(i = 0;i < srcLang.length();i++){
if(text[i] == Translatetest1[0]){
if(text[i+1] == Translatetest1[1]){
if(text[i+2] == Translatetest1[2]){
if(text[i+3] == Translatetest1[3]){
ret = " ";
break;
}
}
}
}
}
from potplayer_subtitle_translate_baidu.
from potplayer_subtitle_translate_baidu.
from potplayer_subtitle_translate_baidu.
from potplayer_subtitle_translate_baidu.
Related Issues (20)
- 外挂字幕测试正常,但在线翻译不出 HOT 2
- 无法翻译,测试报错 HOT 10
- 正在编写脚本请教 HOT 3
- 您好朋友 请问 HostLoadLibrary 你调用成功了吗? HOT 3
- error: 54001, error_msg=Invalid Sign HOT 3
- 一测试你这个百度翻译就造成potplayer无响应 HOT 3
- potplayer翻译字幕时视频会出现卡顿现象
- 【百度翻译开放平台】关于通用文本翻译API版本权益调整的通知 HOT 1
- 请问,error:58000,error_msg=INVALID_CLIENT_IP该怎么解决 HOT 2
- .as檔裡有點問題,導致不能翻譯為粵語和越南文 HOT 1
- 大佬啥时候写个potplayer支持aws翻译的api
- as脚本询问 HOT 4
- 大佬能根据彩云小译的api, 做个potplayer字幕翻译插件吗.... HOT 2
- 大佬您好,能否制作一个DeepL api的版本? HOT 1
- 必须要有外挂字幕吗 HOT 1
- 报错 54001 HOT 6
- potplayer启动时报错
- 使用时画面卡顿掉帧 HOT 2
- 无法使用,点击测试出现xxx HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from potplayer_subtitle_translate_baidu.