一起讀Python官方文件學英文- PEP8

2021/07/02閱讀時間約 7 分鐘
小的發現不少會寫程式的人對語言學習也很有興趣,所以決定拋磚引玉,試著分析文法,解釋每個字怎麼用。小的取的文章篇幅很短,希望能夠藉由深入的分析,讓大家試圖理解英文句子的邏輯。
刪減自abridged from https://www.python.org/dev/peps/pep-0008/
原文:
This document gives coding conventions for the Python code comprising the standard library in the main Python distribution.
參考翻譯:
本文描述Python程式碼的寫法慣例,這些寫法也用在Python主程式的標準函數庫中。
解析:
This document 主詞 gives 主要動詞 coding conventions for the Python code comprising the standard library in the main Python distribution 主要受詞.
參考翻譯:本文描述Python程式碼的慣例,我們Python標準的函數庫也是這樣寫。
1. 這個句子最主要的架構是五大基本句型中的S + V + O,主詞是this document(本文件),動詞是gives,因為主詞是第三人稱單數的this document,所以現在式加s。2. 用現在簡單式的原因是因為這是對於現在事實的描述,對作者來說,give這個動作是否完成並不重要,因此不需要使用完成式或者進行式來標明。
3. coding conventions開始到... Python distribution結束是這個句子主要的受詞。英文的受詞只會是名詞片語,在這裡,這個名詞片語以conventions為核心其他都是修飾語。
coding conventions 單位一 for the Python code comprising the standard library in the main Python distribution 單位二
4. 進一步分析,可以將這個比較大的名詞單位拆成兩個單位,單位一語單位二用for連接,表示「給、為了」之類的概念,所以是「python code ...」的「coding conventions」
5. 單位一coding conventions是指程式碼是用慣例,另外一個常見的表達法是`coding style guide` 也是指程式碼要怎麼寫比較容易看懂、比較美的指南
6. 單位二又可以繼續拆解
the Python code 單位二之一 comprising the standard library in the main Python distribution 單位二之二
7. 單位二之一是Python code,Python程式碼
8. 單位二之二是分詞,表主動,表示者個python code comprise(組成)了the standard library in the main Python distribution。這裡也可以寫成which/that comprises the standard library in the main Python distribution,意思一樣。
9. comprise這個字的用法是這樣: 成分 comprise 聚合成的東西
或 聚合成的東西 is comprised of 成分。因此,這裡的語義關係,是這些python code聚合而成Python的標準函數庫(the standard library in the main Python distribution)。
10. Python是個第三方開發的library(函數庫)發展蓬勃的語言,這些函數庫就不屬於standard library的範疇。Standard library特別強調是由官方開發、有權威性的函數庫,因此寫法也比較值得參考。
原文: This style guide evolves over time as additional conventions are identified and past conventions are rendered obsolete by changes in the language itself. Many projects have their own coding style guidelines. In the event of any conflicts, such project-specific guides take precedence for that project.
參考翻譯:本指南會隨Python的改變而與時俱進,時而有增加新的慣例或汰換舊的寫法。許多Python專案有自己的寫法慣例,如果這些寫法語這裡的衝突,以他們的為主。
解析:
This style guide evolves over time 句子一 as 連接詞 additional conventions are identified and past conventions are rendered obsolete by changes in the language itself. 句子二
11. 這邊是用 as 連接兩個子,as在這邊要翻譯作「隨著」
This style guide 主詞 evolves 主要動詞 over time 副詞
1
2. 句子一的主詞是 this style guide 這個「關於寫作風格的指南」,反正就是說明coding寫法慣例的文件
13. evolves是演化、與時俱進的意思
14. over time是在一段時間內漸漸...的意思
additional conventions are identified 二之一 and 連接詞 past conventions are rendered obsolete by changes in the language itself 二之二
1
5. 單位二之一直接翻的話是新的慣例被「identified」(指認)出來,但是其實意思就是新的慣例產生出來的意思
16. 單位二之二是指過去的慣例因為Python語言的演進變得obsolete(過時)的意思
17. render的用法會有三個單位 主詞 -> 受詞-> 受詞補語,意思是主詞使得受詞變成受詞補語所描述的狀態。
這裡如果寫成主動句的話會是 The changes in the language itself 主詞 render 動詞 past conventions 受詞 obsolete 補語
the language依照語境,可以看得出來是在講Python,我們在原文句子裡面看到的是被動句,也就是變成這樣的句型:
past conventions 原本的受詞 are 補上be動詞 rendered 動詞p.p. obsolete 其他單位/補語照抄 by the changes in the language itself 原本的主詞
以上。
為什麼會看到廣告
    8會員
    15內容數
    對工程師友善的(目前免費)英文教材 #工程師 #Coding #Python #Django #English #英文 #文法 #語言學習 #程式
    留言0
    查看全部
    發表第一個留言支持創作者!