Skip to content

Commit

Permalink
[add] add document builder
Browse files Browse the repository at this point in the history
  • Loading branch information
Oneplus committed Oct 20, 2014
1 parent 5a7d898 commit 77ce9b4
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions tools/build-document/build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys

toc = ["简介",
"开始使用ltp",
"使用ltp_test以及模型",
"编程接口",
"使用其他语言调用ltp",
"使用ltp_server",
"实现原理与性能",
"使用训练套件",
"发表论文",
"附录"]

if __name__=="__main__":
if len(sys.argv) < 2 or not os.path.isdir(sys.argv[1]):
print >> sys.stderr, "argument is not a directory"
sys.exit(1)

print """LTP使用文档v3.0
===============
#### 更新信息
* 刘一佳 << [email protected] >> 2014年6月14日,增加使用其他语言调用ltp一节
* 牛国成 << [email protected] >> 2014年5月10日,增加词性词典相关文档
* 韩冰 << [email protected] >> 2014年1月16日,增加模型裁剪相关文档
* 刘一佳 << [email protected] >> 2013年7月17日,创建文档
版权所有:哈尔滨工业大学社会计算与信息检索研究中心
"""

print """## 目录"""

for title in toc:
print "* [%s](#%s)" % (title, title)

print
for title in toc:
try:
fp=open(os.path.join(sys.argv[1], title + ".md"), "r")
except:
continue

print "# %s" % title
print fp.read().strip()
print

0 comments on commit 77ce9b4

Please sign in to comment.