Skip to content

Commit e15e680

Browse files
authored
Merge pull request #83 from afunTW/dev
Using OpenCC to convert from zh-cn to zh-tw
2 parents 03cdebe + df8c173 commit e15e680

23 files changed

+11111
-0
lines changed

Pipfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[[source]]
2+
url = "https://pypi.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[packages]
7+
opencc = "*"
8+
click = "*"
9+
10+
[dev-packages]
11+
12+
[requires]
13+
python_version = "3.6"

Pipfile.lock

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/translate.py

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
"""Convert zh-cn to zh-tw
2+
Refer to https://github.com/BYVoid/OpenCC
3+
"""
4+
import click
5+
import opencc
6+
7+
from pathlib import Path
8+
from pprint import pprint
9+
10+
11+
@click.group()
12+
def cli():
13+
pass
14+
15+
16+
def convert(infile: str, outfile: str, cfg: str):
17+
"""read >> convert >> write file
18+
Args:
19+
infile (str): input file
20+
outfile (str): output file
21+
cfg (str): config
22+
"""
23+
converter = opencc.OpenCC(cfg)
24+
with open(infile, "r") as inf, open(outfile, "w+") as outf:
25+
data = inf.readlines()
26+
data = list(map(converter.convert, data))
27+
outf.writelines(data)
28+
print(f"Convert to {outfile}")
29+
30+
31+
@cli.command()
32+
@click.option("-i", "--input", "infile", required=True)
33+
@click.option("-o", "--output", "outfile", required=True)
34+
@click.option("-c", "--config", "cfg", required=True, default="s2twp.json")
35+
def file(infile: str, outfile: str, cfg: str):
36+
"""read >> convert >> write file
37+
Args:
38+
infile (str): input file
39+
outfile (str): output file
40+
cfg (str): config
41+
"""
42+
convert(infile, outfile, cfg)
43+
44+
45+
@cli.command()
46+
@click.option("-i", "--input", "infolder", required=True)
47+
@click.option("-o", "--output", "outfolder", required=True)
48+
@click.option("-c", "--config", "cfg", required=True, default="s2twp.json")
49+
def repo(infolder, outfolder, cfg):
50+
if not Path(outfolder).exists():
51+
Path(outfolder).mkdir(parents=True)
52+
print(f"Create {outfolder}")
53+
infiles = Path(infolder).resolve().glob("*.md")
54+
pair = [
55+
{"infile": str(infile), "outfile": str(Path(outfolder).resolve() / infile.name)}
56+
for idx, infile in enumerate(infiles)
57+
]
58+
for p in pair:
59+
convert(p["infile"], p["outfile"], cfg)
60+
61+
62+
if __name__ == "__main__":
63+
cli()

zh-tw/README.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# 設計資料密集型應用 - 中文翻譯
2+
3+
- 作者: [Martin Kleppmann](https://martin.kleppmann.com)
4+
- 原書名稱:[《Designing Data-Intensive Application》](http://shop.oreilly.com/product/0636920032175.do)
5+
- 譯者:[馮若航]( http://vonng.com/about)[email protected]
6+
- Gitbook地址:[ddia-cn](https://www.gitbook.com/book/vonng/ddia-cn)
7+
- 使用[Typora](https://www.typora.io)或Gitbook以獲取最佳閱讀體驗。
8+
9+
10+
11+
12+
## 譯序
13+
14+
> 不懂資料庫的全棧工程師不是好架構師
15+
>
16+
> —— Vonng
17+
18+
​ 現今,尤其是在網際網路領域,大多數應用都屬於資料密集型應用。本書從底層資料結構到頂層架構設計,將資料系統設計中的精髓娓娓道來。其中的寶貴經驗無論是對架構師,DBA、還是後端工程師、甚至產品經理都會有幫助。
19+
20+
​ 這是一本理論結合實踐的書,書中很多問題,譯者在實際場景中都曾遇到過,讀來讓人擊節扼腕。如果能早點讀到這本書,該少走多少彎路啊!
21+
22+
​ 這也是一本深入淺出的書,講述概念的來龍去脈而不是賣弄定義,介紹事物發展演化歷程而不是事實堆砌,將複雜的概念講述的淺顯易懂,但又直擊本質不失深度。每章最後的引用質量非常好,是深入學習各個主題的絕佳索引。
23+
24+
​ 本書為資料系統的設計、實現、與評價提供了很好的概念框架。讀完並理解本書內容後,讀者可以輕鬆看破大多數的技術忽悠,與技術磚家撕起來虎虎生風🤣。
25+
26+
​ 這是2017年譯者讀過最好的一本技術類書籍,這麼好的書沒有中文翻譯,實在是遺憾。某不才,願為先進技術文化的傳播貢獻一分力量。既可以深入學習有趣的技術主題,又可以鍛鍊中英文語言文字功底,何樂而不為?
27+
28+
29+
30+
## 前言
31+
32+
> 在我們的社會中,技術是一種強大的力量。資料、軟體、通訊可以用於壞的方面:不公平的階級固化,損害公民權利,保護既得利益集團。但也可以用於好的方面:讓底層人民發出自己的聲音,讓每個人都擁有機會,避免災難。本書獻給所有將技術用於善途的人們。
33+
34+
---------
35+
36+
> 計算是一種流行文化,流行文化鄙視歷史。 流行文化關乎個體身份和參與感,但與合作無關。流行文化活在當下,也與過去和未來無關。 我認為大部分(為了錢)編寫程式碼的人就是這樣的, 他們不知道自己的文化來自哪裡。
37+
>
38+
> ——阿蘭·凱接受Dobb博士的雜誌採訪時(2012年)
39+
40+
41+
42+
## 目錄
43+
44+
### [序言](preface.md)
45+
46+
### [第一部分:資料系統的基石](part-i.md)
47+
48+
* [第一章:可靠性、可擴充套件性、可維護性](ch1.md)
49+
* [第二章:資料模型與查詢語言](ch2.md)
50+
* [第三章:儲存與檢索](ch3.md)
51+
* [第四章:編碼與演化](ch4.md)
52+
53+
### [第二部分:分散式資料](part-ii.md)
54+
55+
* [第五章:複製](ch5.md)
56+
* [第六章:分割槽](ch6.md)
57+
* [第七章:事務](ch7.md)
58+
* [第八章:分散式系統的麻煩](ch8.md)
59+
* [第九章:一致性與共識](ch9.md)
60+
61+
### [第三部分:衍生資料](part-iii.md)
62+
63+
* [第十章:批處理](ch10.md)
64+
* [第十一章:流處理](ch11.md)
65+
* [第十二章:資料系統的未來](ch12.md)
66+
67+
### [術語表](glossary.md)
68+
69+
### [後記](colophon.md)
70+
71+
72+
73+
## 法律宣告
74+
75+
從原作者處得知,已經有簡體中文的翻譯計劃,將於2018年末完成。
76+
77+
譯者純粹出於**學習目的****個人興趣**翻譯本書,不追求任何經濟利益。
78+
79+
譯者保留對此版本譯文的署名權,其他權利以原作者和出版社的主張為準。
80+
81+
本譯文只供學習研究參考之用,不得公開傳播發行或用於商業用途。有能力閱讀英文書籍者請購買正版支援。
82+
83+
84+
85+
## CONTRIBUTION
86+
87+
1. [序言初翻修正](https://github.com/Vonng/ddia/commit/afb5edab55c62ed23474149f229677e3b42dfc2c) by [@seagullbird](https://github.com/Vonng/ddia/commits?author=seagullbird)
88+
2. [第一章語法標點校正](https://github.com/Vonng/ddia/commit/973b12cd8f8fcdf4852f1eb1649ddd9d187e3644) by [@nevertiree](https://github.com/Vonng/ddia/commits?author=nevertiree)
89+
3. [第六章部分校正](https://github.com/Vonng/ddia/commit/d4eb0852c0ec1e93c8aacc496c80b915bb1e6d48)[第10章的初翻](https://github.com/Vonng/ddia/commit/9de8dbd1bfe6fbb03b3bf6c1a1aa2291aed2490e) by @[MuAlex](https://github.com/Vonng/ddia/commits?author=MuAlex)
90+
4. 第一部分前言,ch2校正 by @jiajiadebug
91+
5. 詞彙表、後記關於野豬的部分 by @[Chowss](https://github.com/Vonng/ddia/commits?author=Chowss)
92+
6. 簡體與繁體中文轉換工具 by [@afunTW](https://github.com/afunTW) using [OpenCC](https://github.com/BYVoid/OpenCC)
93+
94+
感謝所有作出貢獻,提出意見的朋友們:[Issues](https://github.com/Vonng/ddia/issues)[Pull Requests](https://github.com/Vonng/ddia/pulls)
95+
96+
97+
98+
## LICENSE
99+
100+
CC-BY 4.0

zh-tw/SUMMARY.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Summary
2+
3+
* [簡介](README.md)
4+
* [序言](preface.md)
5+
* [第一部分:資料系統的基石](part-i.md)
6+
* [第一章:可靠性、可擴充套件性、可維護性](ch1.md)
7+
* [第二章:資料模型與查詢語言](ch2.md)
8+
* [第三章:儲存與檢索](ch3.md)
9+
* [第四章:編碼與演化](ch4.md)
10+
* [第二部分:分散式資料](part-ii.md)
11+
* [第五章:複製](ch5.md)
12+
* [第六章:分割槽](ch6.md)
13+
* [第七章:事務](ch7.md)
14+
* [第八章:分散式系統的麻煩](ch8.md)
15+
* [第九章:一致性與共識](ch9.md)
16+
* [第三部分:衍生資料](part-iii.md)
17+
* [第十章:批處理](ch10.md)
18+
* [第十一章:流處理](ch11.md)
19+
* [第十二章:資料系統的未來](ch12.md)
20+
* [術語表](glossary.md)
21+
* [後記](colophon.md)
22+
23+

0 commit comments

Comments
 (0)