bootstrap apertium语言模块和对

apertium-init的Python项目详细描述


Apertium Init(即Apertium Bootstrap)

Build StatusCoverage StatusPyPIPyPI - Python Version

使用apertium-init.py引导apertium语言模块和对。

用法

首先,download the script 或者使用pip install apertium-initPyPi安装。

使用取决于所需的模块,如下所述。记住 在生成的模块中搜索TODO以添加示例语句等。

单语lttoolbox模块

使用 lttoolbox形式主义,

$ python3 apertium-init.py foo

要同时引导和编译它,

$ python3 apertium-init.py foo &&(cd apertium-foo/ && ./autogen.sh && make )

单语hfst模块

使用 HFST形式主义,

$ python3 apertium-init.py foo --analyser=hfst

要同时引导和编译它,

$ python3 apertium-init.py foo --analyser=hfst &&(cd apertium-foo/ && ./autogen.sh && make )

要包含用于处理前缀的twoc文件,

$ python3 apertium-init.py foo --analyser=hfst --with-twoc

要包含一个spellrelax文件来处理排版差异,

$ python3 apertium-init.py foo --analyser=hfst --with-spellrelax

双语LTtoolbox模块

启动双语语言模块apertium-foo-bar,其中 单语包apertium-fooapertium-bar都使用 lttoolbox形式主义,

$ python3 apertium-init.py foo-bar

要同时引导和编译它,

$ python3 apertium-init.py foo-bar &&(cd apertium-foo-bar/ && ./autogen.sh && make test)

双语hfst/lttoolbox模块

启动双语语言模块apertium-foo-bar,其中 单语包装apertium-fooapertium-bar使用 HFST形式主义和/或 lttoolbox形式主义,

$ python3 apertium-init.py foo-bar --analysers=hfst # Both foo and bar use HFST
$ python3 apertium-init.py foo-bar --analyser1=hfst # Only foo (first language) uses HFST
$ python3 apertium-init.py foo-bar --analyser2=hfst # Only bar (second language) uses HFST

要同时引导和编译它,

$ python3 apertium-init.py foo-bar --analysers=hfst &&(cd apertium-foo-bar/ && ./autogen.sh && make test)# Both foo and bar use HFST
$ python3 apertium-init.py foo-bar --analyser1=hfst &&(cd apertium-foo-bar/ && ./autogen.sh && make test)# Only foo (first language) uses HFST
$ python3 apertium-init.py foo-bar --analyser2=hfst &&(cd apertium-foo-bar/ && ./autogen.sh && make test)# Only bar (second language) uses HFST

双语模块,用于不使用Apertium Tagger或CG的单语者

要在一个或两个单语模块不使用Apertium标记器时引导双语模块,

$ python3 apertium-init.py foo-bar --no-prob1            # Only foo doesn't have .prob
$ python3 apertium-init.py foo-bar --no-prob2            # Only bar doesn't have .prop
$ python3 apertium-init.py foo-bar --no-prob1 --no-prob2 # Neither foo nor bar have .prob

要在一个或两个单语模块不使用CG时引导双语模块,

$ python3 apertium-init.py foo-bar --no-rlx1           # Only foo doesn't have .rlx
$ python3 apertium-init.py foo-bar --no-rlx2           # Only bar doesn't have .rlx
$ python3 apertium-init.py foo-bar --no-rlx1 --no-rlx2 # Neither foo nor bar have .rlx

推送到github

要引导模块或对并将其添加到apertium incubator

$ python3 apertium-init.py foo -p     # Bootstrap module apertium-foo and push to Github
$ python3 apertium-init.py foo-bar -p # Bootstrap pair apertium-foo-bar and push to Github

要指定推送的用户名(而不是依赖于git config),

$ python3 apertium-init.py foo -p -u bar # Bootstrap module apertium-foo and push to Github under username bar

开发

更新vanilla文件后,运行./updateBootstraper.py以更新 apertium-init.py中的相关编码文件。或者,在根目录中运行make 更新所有编码文件。

您还可以执行sudo make install来安装到/usr/local/bin/apertium-init 或者,例如PREFIX=$HOME/local make install安装到$HOME/local/bin/apertium-init

使用pipenv install --dev安装 开发,如绒布。

释放

按照上面的说明安装开发资源之后, 部署到pypi相对简单。

使用make distdist目录中创建可分发的源 可以通过pip本地安装。

使用make test-releasemake release部署到testing PyPi instance 分别是production PyPi instance。要么 步骤需要具有访问apertium init权限的pypi身份验证凭据 包裹。

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

推荐PyPI第三方库


热门话题
windows请帮助获取java。运行程序时发生lang.nullpointerexception   JPA标准中的错误:java。lang.IllegalArgumentException:此JPQLquery中没有名为“:inputMsgId_1_”的参数   java调度一个小程序,从ScheduledExecutorService开始   java点击AVD“创建设备”按钮抛出NullPointerException   缓存Java9WebStart会多次加载jar文件   使用java计算最小二乘   当代理关闭时,java kafka生产者不会抛出异常   我们什么时候以及为什么要在java中进行自定义序列化?   java使用GSON解析包含包含所需字符串的对象的对象数组   java如何使用BOBJ REST API实现分页?   java身份验证失败:用户的凭据已过期。CAS v4。2.   合并排序中的java无限循环?   java jackson xml将pojo子元素转换为字符串   tcp Java ObjectOutputStream重置错误   如何调用。bat文件,并使用java中的ProcessBuilder发送字符串   奇怪的Java数学结果   java如何在Android中禁用最近的活动按钮?   java刷下应用程序崩溃   使用Java收集所有VersionOne资产及其所有属性   Java打印:创建具有最小可接受边距的页面格式