Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Tutorial/datastructures#24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
adrianliaw merged 3 commits intopython:3.7fromunknown repositoryJul 30, 2018
Merged

Tutorial/datastructures#24

adrianliaw merged 3 commits intopython:3.7fromunknown repositoryJul 30, 2018

Conversation

ghost
Copy link

修正四則翻譯

@ghostghost mentioned this pull requestJul 19, 2018
Copy link
Collaborator

@adrianliawadrianliaw left a comment
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

非常感謝你的幫忙!✨

這邊有一些東西希望你能幫忙改一下,主要是關於 fuzzy entry 的修改。Fuzzy entry 都是因為之前原文有一些微調而產生的,所以要麻煩多注意一些原文與原譯文用詞上的差異。

再麻煩你了,如果有不同意我的 review 的地方都歡迎提出來討論,如果有任何問題的話歡迎在聊天室裡發問!

msgstr ""
"搜尋 list 中值為 x 的項目,刪除 list 中第一個成功搜尋的結果(項目)。若 list "
"中無此項目,這會是一個錯誤。"
msgstr "刪除 list 中第一個值為 *x* 的元素。若 list 中無此元素則會產生錯誤。"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

這一系列的 fuzzy entries 主要的變更是 "is" 都改成了 "is equal to",我想是要強調在 Python 裡面is== 的差別,我覺得在翻譯這邊我們也可以把「值為 x」改成「值等於 x」,這樣比較可以避免歧義。

"搜尋 list中值為 x 的項目,回傳第一個成功搜尋結果(項目)的位置(從零開始的索"
"引值)。若 list 中無此項目,就丟出:exc:`ValueError`。"
"回傳 list中第一個值為 *x* 的索引值(從零開始索引)。若 list 中無此項目,則丟"
":exc:`ValueError`錯誤。"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

:exc:`ValueError` 後面少了一個空格,這樣 rST 語法會顯示不出來哦!

msgid ""
"Return zero-based index in the list of the first item whose value is equal "
"to *x*. Raises a :exc:`ValueError` if there is no such item."
msgstr ""
"搜尋 list 中值為 x 的項目,回傳第一個成功搜尋結果(項目)的位置(從零開始的索"
"引值)。若 list 中無此項目,就丟出 :exc:`ValueError`。"
"回傳 list 中第一個值為 *x* 的索引值(從零開始索引)。若 list 中無此項目,則丟"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

同上面的 comment,「值為」應該改成「值等於」

另外,「索引值」在這邊我覺得直接略過 "item" 這個詞的翻譯會有點突兀,也許可以說是「第一個值為 x 的元素的索引值」

s/從零開始索引/從零開始的索引/ 「從零開始的」在這邊是作形容詞修飾索引,應該保留「的」

"其中 key 必須是獨一無二的(在一個 dictionary 裡)。使用一對大括號可以創建一個"
"空的 dict :``{}`` 。把一串由逗號分隔的鍵值對放置於大括號內可以為 dict 提供初"
"始的鍵值對,這也是 dict 輸出時的樣子。"
"思考 dict 最好的方式是把它想成是一組無序鍵值對 (*key: value* pair) 的集合,其"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

原文的上一個變更是把 "as an unordered set of key value pairs" 改成 "a set of key value pairs" [1](我覺得應該是因為 Python 3.7 的dict 保留了 insertion order,並且已經納入 Python spec 中 [2],即非 CPython 特定的特性),所以這邊的「無序」應該要拿掉。

[1] 可以參考$ git log -L 550,559:tutorial/datastructures.po 產生的這幾行翻譯的歷史紀錄
[2]https://mail.python.org/pipermail/python-dev/2017-December/151283.html

"始的鍵值對,這也是 dict 輸出時的樣子。"
"思考 dict 最好的方式是把它想成是一組無序鍵值對 (*key: value* pair) 的集合,其"
"中 key 在同一個 dictionary(字典)裡必須是獨一無二的。使用一對大括號可創建一"
"個空的字典 :``{}`` 。將一串由逗號分隔的鍵對值置於大括號則可初始化字典 。這"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

兩個句點前都多了一個空格

s/鍵對值/鍵值對/

"對 dict 使用 ``list(d.keys())`` 會得到一個含有該 dict 所有鍵,順序為任意排列"
"的 list 。(如果想要排序過的,使用 ``sorted(d.keys())`` 代替即可) [2]_ 要確"
"認一個鍵是否已經存在於 dict 中,使用 :keyword:`in` 關鍵字。"
"對字典使用 ``list(d.keys())`` 會得到一個包含該字典所有鍵 (key),順序為任意排"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

這邊原文是改成list(d) 而非list(d.keys()),另外,順序是按照 insertion order。可以參考$ git log -L 573,582:tutorial/datastructures.po 顯示的歷史紀錄

"的 list 。(如果想要排序過的,使用 ``sorted(d.keys())`` 代替即可) [2]_ 要確"
"認一個鍵是否已經存在於 dict 中,使用 :keyword:`in` 關鍵字。"
"對字典使用 ``list(d.keys())`` 會得到一個包含該字典所有鍵 (key),順序為任意排"
"列的 list 。(若想要排序,則使用 ``sorted(d.keys())`` 代替即可)。如果想確認一"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

第一個句點前多了一個空格

@ghost
Copy link
Author

Hello 感謝你的建議,我已經根據你的建議做了一些修改。

adrianliaw reacted with heart emoji

Copy link
Collaborator

@adrianliawadrianliaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

感謝你的修改,這邊有兩個小小的細節再麻煩你了!

"對 dict 使用 ``list(d.keys())`` 會得到一個含有該 dict 所有鍵,順序為任意排列"
"的 list 。(如果想要排序過的,使用 ``sorted(d.keys())`` 代替即可) [2]_ 要確"
"認一個鍵是否已經存在於 dict 中,使用 :keyword:`in` 關鍵字。"
"對字典使用 ``list(d)`` 會得到一個包含該字典所有鍵 (key),其排列順序為插入時的順序。"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

這邊要說的是「會得到一個包含該字典所有鍵(key)的 list」嗎?

msgid ""
"Return zero-based index in the list of the first item whose value is equal "
"to *x*. Raises a :exc:`ValueError` if there is no such item."
msgstr ""
"搜尋 list 中值為 x 的項目,回傳第一個成功搜尋結果(項目)的位置(從零開始的索"
"引值)。若 list 中無此項目,就丟出 :exc:`ValueError`。"
"回傳 list 中第一個值等於為 *x* 的項目之索引值(從零開始的索引)。若 list 中無此項目,則丟"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

s/值等於為/值等於/

@adrianliawadrianliaw merged commit3edf847 intopython:3.7Jul 30, 2018
@adrianliaw
Copy link
Collaborator

@scTakt Thanks for your contribution! I've fixed the final two comments by myself and merged the PR.

beccalzh pushed a commit to beccalzh/python-docs-zh-tw that referenced this pull requestSep 4, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@adrianliaw@honadmin

[8]ページ先頭

©2009-2025 Movatter.jp