Skip to content

feat: translate rest part of library/bisect.po #329

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 39 additions & 2 deletions library/bisect.po
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
#
# Translators:
# 周 忠毅 <rilakcrc35@gmail.com>, 2016
# Liang-Bo Wang <me@liang2.tw>, 2017
# pertertc <petertc.chu@gmail.com>, 2022
# Matt Wang <mattwang44@gmail.com>, 2022
msgid ""
msgstr ""
"Project-Id-Version: Python 3.11\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-09-26 00:21+0000\n"
"PO-Revision-Date: 2022-08-27 16:41+0800\n"
"Last-Translator: Liang-Bo Wang <me@liang2.tw>\n"
"PO-Revision-Date: 2022-10-17 10:53+0800\n"
"Last-Translator: Matt Wang <mattwang44@gmail.com>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
"tw)\n"
"Language: zh_TW\n"
Expand Down Expand Up @@ -161,18 +164,24 @@ msgid ""
"When writing time sensitive code using *bisect()* and *insort()*, keep these "
"thoughts in mind:"
msgstr ""
"若在需要關注寫入時間的程式當中使用 *bisect()* 和 *insort()*,請特別注意幾個事"
"項:"

#: ../../library/bisect.rst:113
msgid ""
"Bisection is effective for searching ranges of values. For locating specific "
"values, dictionaries are more performant."
msgstr ""
"二分法在一段範圍的數值中做搜索的效率較佳,但若是要存取特定數值,使用字典的表"
"現還是比較好。"

#: ../../library/bisect.rst:116
msgid ""
"The *insort()* functions are ``O(n)`` because the logarithmic search step is "
"dominated by the linear time insertion step."
msgstr ""
"*insort()* 函式的複雜度為 ``O(n)``,因為對數搜尋是以線性時間的插入步驟所主導 "
"(dominate)。"

#: ../../library/bisect.rst:119
msgid ""
Expand All @@ -184,13 +193,20 @@ msgid ""
"an array of precomputed keys to locate the insertion point (as shown in the "
"examples section below)."
msgstr ""
"搜索函式為無狀態的 (stateless),且鍵函式會在使用過後被丟棄。因此,如果搜索函"
"式被使用於迴圈當中,鍵函式會不斷被重複呼叫於相同的 list 元素。如果鍵函式執行"
"速度不快,請考慮將其以 :func:`functools.cache` 包裝起來以減少重複的計算。另"
"外,也可以透過搜尋預先計算好的鍵列表 (array of precomputed keys) 來定位插入點"
"(如下方範例所示)。"

#: ../../library/bisect.rst:129
msgid ""
"`Sorted Collections <https://grantjenks.com/docs/sortedcollections/>`_ is a "
"high performance module that uses *bisect* to managed sorted collections of "
"data."
msgstr ""
"`有序容器 (Sorted Collections) <https://grantjenks.com/docs/"
"sortedcollections/>`_ 是一個使用 *bisect* 來管理資料之有序集合的高效能模組。"

#: ../../library/bisect.rst:133
msgid ""
Expand All @@ -200,6 +216,10 @@ msgid ""
"keys are precomputed to save unnecessary calls to the key function during "
"searches."
msgstr ""
"`SortedCollection recipe <https://code.activestate.com/recipes/577197-"
"sortedcollection/>`_ 使用二分法來建立一個功能完整的集合類別 (collection "
"class) 並帶有符合直覺的搜索方法 (search methods) 與支援鍵函式。鍵會預先被計算"
"好,以減少搜索過程中多餘的鍵函式呼叫。"

#: ../../library/bisect.rst:141
msgid "Searching Sorted Lists"
Expand All @@ -212,6 +232,10 @@ msgid ""
"following five functions show how to transform them into the standard "
"lookups for sorted lists::"
msgstr ""
"上面的 :func:`bisect` 函式在找到數值插入點上很有用,但一般的數值搜尋任務上就"
"不是那麼的方便。以下的五個函式展示了如何將其轉換成標準的有序列表查找函式:\n"
"\n"
"::"

#: ../../library/bisect.rst:185
msgid "Examples"
Expand All @@ -224,16 +248,29 @@ msgid ""
"(say) based on a set of ordered numeric breakpoints: 90 and up is an 'A', 80 "
"to 89 is a 'B', and so on::"
msgstr ""
":func:`bisect` 函式可用於數值表中的查找 (numeric table lookup),這個範例使"
"用 :func:`bisect` 以基於一組有序的數值分界點來為一個考試成績找到相對應的字母"
"等級:90 以上是 'A'、80 到 89 為 'B',依此類推:\n"
"\n"
"::"

#: ../../library/bisect.rst:201
msgid ""
"The :func:`bisect` and :func:`insort` functions also work with lists of "
"tuples. The *key* argument can serve to extract the field used for ordering "
"records in a table::"
msgstr ""
":func:`bisect` 與 :func:`insort` 函式也適用於內容為 tuples(元組)的 lists,"
"*key* 引數可被用以取出在數值表中作為排序依據的欄位:\n"
"\n"
"::"

#: ../../library/bisect.rst:235
msgid ""
"If the key function is expensive, it is possible to avoid repeated function "
"calls by searching a list of precomputed keys to find the index of a record::"
msgstr ""
"如果鍵函式會消耗較多運算資源,那可以在預先計算好的鍵列表中搜索該紀錄的索引"
"值,以減少重複的函式呼叫:\n"
"\n"
"::"