devatrans是梵语音译、反音译、互译的一个简单易用的工具。

devatrans的Python项目详细描述


天成

这是一个简单的工具音译梵语文本到IAST,Harvard Kyoto,ITRANS,Velthuis convention。它也可以用于从IAST、Harvard Kyoto、ITRANS、Velthuis convention到梵语的^{str1}$back音译。它可用于从一个约定到另一个约定之间的跨音译。在

它与:

          International Alphabet of Sanskrit Transliteration(IAST)
          Indian language transliteration(ITRANS)
          Harvard-Kyoto(HK)
          Velthuis

代码示例


^{pr2}$

一个句子的音译。在

trans=dt.transliterate(input_type="sen",to_convention="hk",sentence="नारायणं")print(trans)#output: nArAyaNaM

文本文件的音译。在

dt.transliterate(input_type="file",to_convetion="iast",inp_file_path="path_to_inp_file",op_file_path="path_to_out_file")

一个句子的反音译。在

back_trans=dt.back_transliterate(input_type="sen",from_convention="hk",sentence="nArAyaNaM")print(back_trans)#output: नारायणं

文本文件的反音译。在

dt.back_transliterate(input_type="file",from_convention="itrans",inp_file_path="path_to_inp_file",op_file_path="path_to_out_file")

句间音译

inter_trans=dt.inter_transliterate(input_type="sen",from_convention="hk",to_convention="velthuis",sentence="nArAyaNaM")

文本文件的互译。在

dt.inter_transliterate(input_type="file",from_convention="itrans",to_convention="iast",inp_file_path="path_to_inp_file",op_file_path="path_to_out_file")

安装


pip install devatrans

如何使用?在


transliterate(input_type,to_convention,inp_file_path=None,op_file_path=None,sentence=None)

The input_type can either be "sen" or "file", if the input_type is file then inp_file_path should be provided, the op_file_path is optional, if not specified the transliterated text is written back to inp_file_path`.

Use this method to transliterate text from SANSKRIT to IAST, ITRANS, HARVARD-KYOTO, VELHTUIS.

If characters which are not part of the convention are encoutered they are left unchanged.

inter_transliterate(input_type,from_convention,to_convention,inp_file_path=None,op_file_path=None,sentence=None)

The input_type can either be "sen" or "file", if the input_type is file then inp_file_path should be provided, the op_file_path is optional, if not specified the transliterated text is written back to inp_file_path`.

Use this method to transliterate text from one convetion to another.

If characters which are not part of the convention are encoutered they are left unchanged.

back_transliterate(input_type,from_convention,inp_file_path=None,op_file_path=None,sentence=None):

The input_type can either be "sen" or "file", if the input_type is file then inp_file_path should be provided, the op_file_path is optional, if not specified the transliterated text is written back to inp_file_path`.

Use this method to back transliterate text from IAST, ITRANS, HARVARD-KYOTO, VELHTUIS to SANSKRIT.

If characters which are not part of the convention are encoutered they are left unchanged.

to_conventionfrom_convnetion只能取值hkiastitransvelthuis

贡献


  • 目前只支持.txt格式,可以扩展为PDF和其他文件格式。在
  • 其他惯例,如梵语库拼音基本(SLP1),WX符号可以包括在内。在

参考文献


TY-书籍 AU-Nair,Jayashree 阿南德,萨达西万 2018年3月30日 SP公司- T1-一个基于哈佛京都协议的罗马天成文书反音译算法 呃-

发行


如果遇到错误,请打开问题here
我的邮件ravitejtasubilli@gmail.com

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java在某些练习中避免索引异常   java Android,如何在具有socket的网络区域上提高性能?   更改web中的执行顺序后,JavaServlet过滤器不起作用。xml   java如何绑定泛型类?   JavaGmail RESTAPI:使用Google凭证而不模拟   java是解码整数序列的最快方法   java根据hashmaps的值(通过map的值进行比较)对hashmaps的数组列表进行排序   用于JBoss 7.1或Apache的java负载平衡器,带有Healt检查   java非常慢的MySQL读取性能   java如何在使用iRetryAnalyzer时从Windows CMD关闭Selenium WebDriver?   java随机闪烁仅出现在Galaxy Note 4上   java AttributeOverride MappedSuperClass属性的类型不同   java JPA:如何检测现有实体是否已更新?   java如何使用mavenassemblyplugin从dependencySet中删除METAINF?   安装SecurityManager时,java MQQueueManager构造函数挂起