text to ipa
Version 1.0
在JavaScript中发短信给IPA转换器
这带有核心词典查找和示例前端。该项目假设您将在某种形式的浏览器中运行此翻译器。 text-to-ipa.js包含用于加载ipadict.txt并查找单词的主要逻辑,而converter-form.js和example-translator.html提供了接口。
在各个.js文件中可以找到有关这一切的发生方式的进一步阅读,在这些文件中可以找到大量文档。
您可以使用的一个示例是在example-translator.html文件中。只需下载存储库并在Web浏览器中打开该文件即可。
该工具意味着将使用CMU-IPA词典。您可以将想要的任何字典加载到此程序中,但是查找单词的方法假设它将处于CMU格式。
这是一个痛苦的工作,因为大多数时候都发现在这里寻找一本最终在这里找到的好的IPA词典。默认情况下,此存储库中包含该字典。
< script src =" ./text-to-ipa.js " > </ script >
< script src =" ./converter-form.js " > </ script > window . onload = TextToIPA . loadDict ( './ipadict.txt' ) ; < div id =" js-text-to-ipa-form " >
< ul style =" list-style-type: none; " >
< li > < textarea id =" ipa-in " placeholder =" Write text here! " rows =" 4 " cols =" 50 " > </ textarea > </ li >
< li class =" button " > < button type =" button " id =" js-ipa-submit " onClick =" ConverterForm.convert('ipa-in', 'ipa-out', 'ipa-err') " > Convert! </ button > </ li >
< li > < textarea readonly id =" ipa-out " placeholder =" aʊtpʊt gəʊz hɪə! " rows =" 4 " cols =" 50 " > </ textarea > </ li >
</ ul >
< ul style =" list-style-type: none; " >
< li > < noscript > < p > This converter will not work unless Javascript is enabled. </ p > </ noscript > </ li >
< li >
< div id =" ipa-err " >
< p > Errors will go here if you make any. (This will be overwritten!) </ p >
</ div >
</ li >
</ ul >
</ div >有关更多信息,请参见示例。
对于风格,更好的版本,而不是没有CSS的版本,您可以在我的网站上对其进行测试
该转换器将仅查找CMU中的每个单词到IPA字典中,然后弹出所得的语音文本。
该代码是根据GNU通用公共许可证发布的。该存储库中的所有作品均应根据本许可使用。您有权在所有衍生作品必须使用GPL版本3的情况下,进行混音,重塑和重新分配此程序。
CMU IPA词典