Skip to content
New issue

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

自订脚本可以增加更多例句(sentence)吗? #318

Closed
ohyeah5566 opened this issue Sep 14, 2023 · 6 comments
Closed

自订脚本可以增加更多例句(sentence)吗? #318

ohyeah5566 opened this issue Sep 14, 2023 · 6 comments

Comments

@ohyeah5566
Copy link

开发者好,这是我遇过最好用的学英文道具了

我使用的模板是ODH,除了原本的sentence外
还新增了sentence1、sentence2
希望能透过自订脚本的方式,将单字的例句放入sentence1 和 sentence2

例如查到的单字如下,字典提供了两个例句
greeting,問候;招呼;迎接

想将
They briskly exchanged greetings before starting the session. 放入sentence1
He nodded his head in greeting. 放入sentence2

请问这是有办法做到的吗?

@ohyeah5566 ohyeah5566 changed the title 自订脚本可以增加更多sentence吗? 自订脚本可以增加更多例句(sentence)吗? Sep 14, 2023
@ninja33
Copy link
Owner

ninja33 commented Sep 14, 2023 via email

@ohyeah5566
Copy link
Author

词典本身带的例句,除了放在glossary里,我也想把例句放到 sentence1 和 sentence2 的欄位
就像下面的图片那样。
目前是用手动的方式做这件事,在想有没有办法透过自订脚本完成这件事
anki_RbRvRWVNIz

@ninja33
Copy link
Owner

ninja33 commented Sep 14, 2023 via email

@ohyeah5566
Copy link
Author

ohyeah5566 commented Sep 14, 2023

你新建两个栏位sentence1和sentence2,最后的目的是什么?是准备在卡片模版上摆放?

有两个目的

  1. 卡片正面,会随机拿 sentence, sentence1, sentence2 来显示
    卡片正面
    {{expression}}
    {{sentence or sentence1 or sentence2}}
  2. 我希望让sentence可以有语音
    有找到一个 anki套件 可以将text转成audio (tts)
    用法是选择field然后就能产生audio

所以最后的呈现就是
卡片的正片除了播放单字以外,还会随机选一个sentence显示并唸出

如果只有1这个需求的话,觉得好酷,没想到css还能这样玩
但因为有2的需求,可能就不行这样了

另一个思路可能是,把text转成audio的方式,也放在脚本上
然后将sentence audio 塞在glossary,再用操作css的方式,显示其中一个sentence 和 播放语音
风险就是脚本只能放在公开网页上,text转成audio会需要使用API key,有点危险

@ohyeah5566
Copy link
Author

考慮到有些字典提供的例句太簡短,現階段還是手動新增好了

@ohyeah5566
Copy link
Author

感谢之前的回复!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants