11# SOME DESCRIPTIVE TITLE.
2- # Copyright (C) 2001-2022 , Python Software Foundation
2+ # Copyright (C) 2001-2023 , Python Software Foundation
33# This file is distributed under the same license as the Python package.
4- # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
54#
6- #, fuzzy
5+ # Translators:
6+ # Matt Wang <mattwang44@gmail.com>, 2023
77msgid ""
88msgstr ""
99"Project-Id-Version :Python 3.11\n "
1010"Report-Msgid-Bugs-To :\n "
1111"POT-Creation-Date :2023-02-15 00:17+0000\n "
12- "PO-Revision-Date :YEAR-MO-DA HO:MI+ZONE \n "
13- "Last-Translator :FULL NAME <EMAIL@ADDRESS >\n "
12+ "PO-Revision-Date :2023-01-04 16:35+0800 \n "
13+ "Last-Translator :Matt Wang <mattwang44@gmail.com >\n "
1414"Language-Team :Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
1515"tw)\n "
1616"Language :zh_TW\n "
1717"MIME-Version :1.0\n "
1818"Content-Type :text/plain; charset=UTF-8\n "
1919"Content-Transfer-Encoding :8bit\n "
20+ "Plural-Forms :nplurals=1; plural=0;\n "
21+ "X-Generator :Poedit 3.2.2\n "
2022
2123#: ../../library/graphlib.rst:2
2224msgid ":mod:`graphlib` --- Functionality to operate with graph-like structures"
23- msgstr ""
25+ msgstr ":mod:`graphlib` —-- 使用類圖 (graph-like) 結構進行操作的功能 "
2426
2527#: ../../library/graphlib.rst:8
2628msgid "**Source code:** :source:`Lib/graphlib.py`"
@@ -31,6 +33,8 @@ msgid ""
3133"Provides functionality to topologically sort a graph of :term:`hashable` "
3234"nodes."
3335msgstr ""
36+ "提供對包含\\ :term:`可雜湊 (hashable) <hashable>` 節點之圖 (graph) 進行拓撲排序 (topologically "
37+ "sort) 的功能。"
3438
3539#: ../../library/graphlib.rst:22
3640msgid ""
@@ -43,6 +47,12 @@ msgid ""
4347"topological ordering is possible if and only if the graph has no directed "
4448"cycles, that is, if it is a directed acyclic graph."
4549msgstr ""
50+ "拓撲排序是圖中頂點 (vertex) 的線性排序,使得對於從頂點 u 到頂點 v 的每條有向"
51+ "邊 (directed edge) u -> v,頂點 u 在排序中會位於頂點 v 之前。例如,圖的頂點可"
52+ "能代表要執行的任務,而邊可能代表一個任務必須在另一個任務之前執行的限制;在此"
53+ "範例中,拓撲排序只是任務的一種有效序列。若且唯若 (if and only if) 圖沒有有向"
54+ "環 (directed cycle) 時,即如果它是個有向無環圖 (directed acyclic graph),則完"
55+ "整的拓撲排序才是可行的。"
4656
4757#: ../../library/graphlib.rst:31
4858msgid ""
@@ -52,58 +62,73 @@ msgid ""
5262"nodes that have edges that point to the value in the key). Additional nodes "
5363"can be added to the graph using the :meth:`~TopologicalSorter.add` method."
5464msgstr ""
65+ "如果提供了可選的 *graph* 引數,它必須是表示有向無環圖的字典,其中鍵是節點,值"
66+ "是圖中該節點的包含所有前驅節點 (predecessor) 之可疊代物件(這些前驅節點具有指"
67+ "向以鍵表示之節點的邊)。可以使用 :meth:`~TopologicalSorter.add` 方法將其他節"
68+ "點新增到圖中。"
5569
5670#: ../../library/graphlib.rst:37
5771msgid ""
5872"In the general case, the steps required to perform the sorting of a given "
5973"graph are as follows:"
60- msgstr ""
74+ msgstr "在一般情況下,對給定的圖執行排序所需的步驟如下: "
6175
6276#: ../../library/graphlib.rst:40
6377msgid ""
6478"Create an instance of the :class:`TopologicalSorter` with an optional "
6579"initial graph."
66- msgstr ""
80+ msgstr "以選用的初始圖建立 :class:`TopologicalSorter` 的實例。 "
6781
6882#: ../../library/graphlib.rst:42
6983msgid "Add additional nodes to the graph."
70- msgstr ""
84+ msgstr "在圖中新增其他節點。 "
7185
7286#: ../../library/graphlib.rst:43
7387msgid "Call :meth:`~TopologicalSorter.prepare` on the graph."
74- msgstr ""
88+ msgstr "呼叫圖的 :meth:`~TopologicalSorter.prepare`。 "
7589
7690#: ../../library/graphlib.rst:44
7791msgid ""
7892"While :meth:`~TopologicalSorter.is_active` is ``True``, iterate over the "
7993"nodes returned by :meth:`~TopologicalSorter.get_ready` and process them. "
8094"Call :meth:`~TopologicalSorter.done` on each node as it finishes processing."
8195msgstr ""
96+ "當 :meth:`~TopologicalSorter.is_active` 為 ``True`` 時,疊代 :meth:"
97+ "`~TopologicalSorter.get_ready` 回傳的節點並處理它們。在每個節點完成處理時呼"
98+ "叫 :meth:`~TopologicalSorter.done`。"
8299
83100#: ../../library/graphlib.rst:49
84101msgid ""
85102"In case just an immediate sorting of the nodes in the graph is required and "
86103"no parallelism is involved, the convenience method :meth:`TopologicalSorter."
87104"static_order` can be used directly:"
88105msgstr ""
106+ "如果只需要立即對圖中的節點進行排序且不涉及平行性 (parallelism),則可以直接使"
107+ "用便捷方法 :meth:`TopologicalSorter.static_order`:"
89108
90109#: ../../library/graphlib.rst:60
91110msgid ""
92111"The class is designed to easily support parallel processing of the nodes as "
93112"they become ready. For instance::"
94113msgstr ""
114+ "該類別設計為在節點準備就緒時,簡單支援節點的平行處理。例如:\n"
115+ "\n"
116+ "::"
95117
96118#: ../../library/graphlib.rst:87
97119msgid ""
98120"Add a new node and its predecessors to the graph. Both the *node* and all "
99121"elements in *predecessors* must be :term:`hashable`."
100122msgstr ""
123+ "向圖中新增新節點及其前驅節點。*node* 和 *predecessors* 中的所有元素都必須是\\ :term:`可雜湊 <hashable>`\\ "
124+ "的。"
101125
102126#: ../../library/graphlib.rst:90
103127msgid ""
104128"If called multiple times with the same node argument, the set of "
105129"dependencies will be the union of all dependencies passed in."
106130msgstr ""
131+ "如果以相同節點引數多次呼叫,則依賴項的集合將會是傳入的所有依賴項的聯集。"
107132
108133#: ../../library/graphlib.rst:93
109134msgid ""
@@ -112,11 +137,16 @@ msgid ""
112137"provided before is included among *predecessors* it will be automatically "
113138"added to the graph with no predecessors of its own."
114139msgstr ""
140+ "可以新增一個沒有依賴關係的節點(*predecessors* 未提供)或提供兩次依賴關係。如"
141+ "果有之前未曾提供的節點被包含在 *predecessors* 中,它將自動新增到沒有前驅節點"
142+ "的圖中。"
115143
116144#: ../../library/graphlib.rst:98
117145msgid ""
118146"Raises :exc:`ValueError` if called after :meth:`~TopologicalSorter.prepare`."
119147msgstr ""
148+ "如果在 :meth:`~TopologicalSorter.prepare` 之後呼叫,則引發 :exc:"
149+ "`ValueError`。"
120150
121151#: ../../library/graphlib.rst:102
122152msgid ""
@@ -127,6 +157,10 @@ msgid ""
127157"be modified, and therefore no more nodes can be added using :meth:"
128158"`~TopologicalSorter.add`."
129159msgstr ""
160+ "將圖標記為已完成並檢查圖中的循環。如果檢測到任何循環,將引發 :exc:"
161+ "`CycleError`,但 :meth:`~TopologicalSorter.get_ready` 仍可用於盡可能獲得更多"
162+ "的節點,直到循環阻塞了進度。呼叫此函式後就無法修改圖,因此無法使用 :meth:"
163+ "`~TopologicalSorter.add` 來新增更多節點。"
130164
131165#: ../../library/graphlib.rst:111
132166msgid ""
@@ -137,29 +171,44 @@ msgid ""
137171"`TopologicalSorter.done` is less than the number that have been returned by :"
138172"meth:`TopologicalSorter.get_ready`."
139173msgstr ""
174+ "如果可以有更多進度則回傳 ``True``,否則回傳 ``False``。如果循環不阻塞解析 "
175+ "(resolution) 並且仍有節點準備就緒但尚未由 :meth:`TopologicalSorter."
176+ "get_ready` 回傳或標記為 :meth:`TopologicalSorter.done` 的節點數量較 :meth:"
177+ "`TopologicalSorter.get_ready` 所回傳的少,則可以繼續取得進度。"
140178
141179#: ../../library/graphlib.rst:118
142180msgid ""
143181"The :meth:`~TopologicalSorter.__bool__` method of this class defers to this "
144182"function, so instead of::"
145183msgstr ""
184+ "此類別的 :meth:`~TopologicalSorter.__bool__` 方法遵循此函式,因此以下做法:\n"
185+ "\n"
186+ "::"
146187
147188#: ../../library/graphlib.rst:124
148189msgid "it is possible to simply do::"
149190msgstr ""
191+ "可以簡單地用以下方式替換:\n"
192+ "\n"
193+ "::"
150194
151195#: ../../library/graphlib.rst:129 ../../library/graphlib.rst:152
152196msgid ""
153197"Raises :exc:`ValueError` if called without calling :meth:`~TopologicalSorter."
154198"prepare` previously."
155199msgstr ""
200+ "如果呼叫之前沒有先呼叫 :meth:`~TopologicalSorter.prepare` 則引發 :exc:"
201+ "`ValueError`。"
156202
157203#: ../../library/graphlib.rst:134
158204msgid ""
159205"Marks a set of nodes returned by :meth:`TopologicalSorter.get_ready` as "
160206"processed, unblocking any successor of each node in *nodes* for being "
161207"returned in the future by a call to :meth:`TopologicalSorter.get_ready`."
162208msgstr ""
209+ "將 :meth:`TopologicalSorter.get_ready` 回傳的一組節點標記為已處理,停止阻塞 "
210+ "*nodes* 中每個節點的任何後繼節點 (successor),以便將來通過呼叫 :meth:"
211+ "`TopologicalSorter.get_ready` 回傳。"
163212
164213#: ../../library/graphlib.rst:138
165214msgid ""
@@ -169,6 +218,10 @@ msgid ""
169218"meth:`~TopologicalSorter.prepare` or if node has not yet been returned by :"
170219"meth:`~TopologicalSorter.get_ready`."
171220msgstr ""
221+ "若沒有和該呼叫一起呼叫 :meth:`~TopologicalSorter.prepare` 或節點還沒有被 :"
222+ "meth:`~TopologicalSorter.get_ready` 回傳,且如果 *nodes* 中有任何節點已被先前"
223+ "對此方法的呼叫標記為已處理、或者未使用 :meth:`TopologicalSorter.add` 將節點新"
224+ "增到圖中,則引發 :exc:`ValueError`。"
172225
173226#: ../../library/graphlib.rst:146
174227msgid ""
@@ -178,6 +231,10 @@ msgid ""
178231"nodes that have all their predecessors already processed. Once no more "
179232"progress can be made, empty tuples are returned."
180233msgstr ""
234+ "回傳一個包含所有準備就緒節點的 ``tuple``。最初它回傳沒有前驅節點的所有節點,"
235+ "一旦通過呼叫 :meth:`TopologicalSorter.done` 來將這些節點標記為已處理後,進一"
236+ "步的呼叫將回傳所有其全部前驅節點都已被處理的新節點。若無法取得更多進度,將回"
237+ "傳空 tuple。"
181238
182239#: ../../library/graphlib.rst:157
183240msgid ""
@@ -186,12 +243,17 @@ msgid ""
186243"`~TopologicalSorter.done` should not be called. This method is equivalent "
187244"to::"
188245msgstr ""
246+ "回傳一個可疊代物件,它將按拓撲排序疊代節點。使用此方法時,不應呼叫 :meth:"
247+ "`~TopologicalSorter.prepare` 和 :meth:`~TopologicalSorter.done`。此方法等效"
248+ "於:\n"
249+ "\n"
250+ "::"
189251
190252#: ../../library/graphlib.rst:169
191253msgid ""
192254"The particular order that is returned may depend on the specific order in "
193255"which the items were inserted in the graph. For example:"
194- msgstr ""
256+ msgstr "回傳的特定順序可能取決於將項目插入圖中的特定順序。例如: "
195257
196258#: ../../library/graphlib.rst:186
197259msgid ""
@@ -200,25 +262,31 @@ msgid ""
200262"`~TopologicalSorter.get_ready`) and the order between them is determined by "
201263"the order of insertion."
202264msgstr ""
265+ "這是因為\" 0\" 和\" 2\" 在圖中處於同一級別(它們將在對 :meth:"
266+ "`~TopologicalSorter.get_ready` 的同一呼叫中回傳)並且它們之間的順序取決於插入"
267+ "順序。"
203268
204269#: ../../library/graphlib.rst:192
205270msgid "If any cycle is detected, :exc:`CycleError` will be raised."
206- msgstr ""
271+ msgstr "如果檢測到任何循環,則引發 :exc:`CycleError`。 "
207272
208273#: ../../library/graphlib.rst:198
209274msgid "Exceptions"
210275msgstr "例外"
211276
212277#: ../../library/graphlib.rst:199
213278msgid "The :mod:`graphlib` module defines the following exception classes:"
214- msgstr ""
279+ msgstr ":mod:`graphlib` 模組定義了以下例外類別: "
215280
216281#: ../../library/graphlib.rst:203
217282msgid ""
218283"Subclass of :exc:`ValueError` raised by :meth:`TopologicalSorter.prepare` if "
219284"cycles exist in the working graph. If multiple cycles exist, only one "
220285"undefined choice among them will be reported and included in the exception."
221286msgstr ""
287+ ":exc:`ValueError` 的子類別,如果作用的圖中存在循環則由 :meth:"
288+ "`TopologicalSorter.prepare` 引發。如果存在多個循環,則只會報告未定義的其中一個"
289+ "並包含在例外中。"
222290
223291#: ../../library/graphlib.rst:207
224292msgid ""
@@ -228,3 +296,7 @@ msgid ""
228296"predecessor of the next node in the list. In the reported list, the first "
229297"and the last node will be the same, to make it clear that it is cyclic."
230298msgstr ""
299+ "檢測到的循環可以通過例外實例的 :attr:`~CycleError.args` 屬性中第二個元素來存"
300+ "取,其為一個節點列表,每個節點在圖中都是列表中下一個節點的直接前驅節點"
301+ "(immediate predecessor,即父節點)。在報告列表中,第一個和最後一個節點將會是"
302+ "相同的,用以明確表示它是循環的。"