提交 5bd1ef47 编写于 作者: A Aston Zhang

add translate.sh

上级 1599341e
......@@ -2,7 +2,7 @@
这是一个深度学习的教学项目。我们将使用 [Apache MXNet (incubating)](https://github.com/apache/incubator-mxnet) 的最新 gluon 接口来演示如何从0开始实现深度学习的各个算法。我们的将利用 [Jupyter notebook](http://jupyter.org/) 能将文档,代码,公式和图形统一在一起的优势,提供一个交互式的学习体验。这个项目可以作为一本书,上课用的材料,现场演示的案例,和一个可以尽情拷贝的代码库。据我们所知,目前并没有哪个项目能既覆盖全面深度学习,又提供交互式的可执行代码。我们将尝试弥补这个空白。
- [第一季十九课视频汇总](https://discuss.gluon.ai/t/topic/753)(本教程不断改进中。视频中使用的[版本](https://github.com/mli/gluon-tutorials-zh/archive/v0.61.zip)
- [第一季十九课视频汇总](https://discuss.gluon.ai/t/topic/753)(本教程不断改进中。视频中使用的[版本](https://github.com/mli/gluon-tutorials-zh/archive/v0.61.zip)
- [可打印的 PDF 版本在这里](./gluon_tutorials_zh.pdf)
- 课程源代码在 [Github](https://github.com/mli/gluon-tutorials-zh) (亲,给个好评加颗星)
- 请使用 [http://discuss.gluon.ai/](http://discuss.gluon.ai/) 来进行讨论
......
......@@ -7,21 +7,36 @@ pre() {
sed -i s/\.python\ \.input/\.python-\.input/g $f
sed -i s/\.input\ \ n=/\.input-n=/g $f
sed -i s/\</%%%less-than%%%/g $f
sed -i s/\&/%%%ampersand%%%/g $f
done
}
extract() {
echo "Convert markdown files into xliff (in source language) and skeleton files.";
BSL="bookSrcLang"
[ -e $BSL ] && rm -rf $BSL
mkdir -p $BSL
for f in chapter*/*.md; do
echo $f
./md2xliff/bin/extract $f
xlf="${f%%.*}.xlf"
sklmd="${f%%.*}.skl.md"
./md2xliff/bin/extract $f $xlf $sklmd 'zh-CN' 'en-US'
# Generate bookSrcLang that contains only xlf files.
dir=$(dirname "$f")
mkdir -p $BSL/$dir
base=$(basename $f)
xlf_base="${base%%.*}.xlf"
cp $xlf $BSL/$dir/$xlf_base
done
}
reconstruct() {
echo "Convert xliff (in target language) and skeleton files into markdown files.";
BTL="bookTgtLang"
for f in chapter*/*.xlf; do
echo $f
# Load xlf files from translated dir.
cp $BTL/$f $f
md="${f%%.*}.md"
sklmd="${f%%.*}.skl.md"
./md2xliff/bin/xliff-reconstruct $f $sklmd $md
......@@ -37,6 +52,7 @@ post() {
sed -i s/\.python-\.input/\.python\ \.input/g $f
sed -i s/\.input-n=/\.input\ \ n=/g $f
sed -i s/%%%less-than%%%/\</g $f
sed -i s/%%%ampersand%%%/\\\&/g $f
done
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册