1
1
# SOME DESCRIPTIVE TITLE.
2
- # Copyright (C) 2001-2022 , Python Software Foundation
2
+ # Copyright (C) 2001-2023 , Python Software Foundation
3
3
# This file is distributed under the same license as the Python package.
4
- # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
4
#
6
- #, fuzzy
5
+ # Translators:
6
+ # Matt Wang <[email protected] >, 2023
7
7
msgid ""
8
8
msgstr ""
9
9
"Project-Id-Version : Python 3.11\n "
10
10
"Report-Msgid-Bugs-To : \n "
11
11
"POT-Creation-Date : 2021-09-13 00:11+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 <[email protected] >\n"
14
14
"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
15
15
"tw)\n "
16
16
"Language : zh_TW\n "
17
17
"MIME-Version : 1.0\n "
18
18
"Content-Type : text/plain; charset=UTF-8\n "
19
19
"Content-Transfer-Encoding : 8bit\n "
20
+ "Plural-Forms : nplurals=1; plural=0;\n "
21
+ "X-Generator : Poedit 3.2.2\n "
20
22
21
23
#: ../../library/graphlib.rst:2
22
24
msgid ":mod:`graphlib` --- Functionality to operate with graph-like structures"
23
- msgstr ""
25
+ msgstr ":mod:`graphlib` —-- 使用類圖 (graph-like) 結構進行操作的功能 "
24
26
25
27
#: ../../library/graphlib.rst:8
26
28
msgid "**Source code:** :source:`Lib/graphlib.py`"
@@ -29,6 +31,8 @@ msgstr "**原始碼:**\\ :source:`Lib/graphlib.py`"
29
31
#: ../../library/graphlib.rst:20
30
32
msgid "Provides functionality to topologically sort a graph of hashable nodes."
31
33
msgstr ""
34
+ "提供對包含可雜湊 (hashable) 節點之圖 (graph) 進行拓撲排序 (topologically "
35
+ "sort) 的功能。"
32
36
33
37
#: ../../library/graphlib.rst:22
34
38
msgid ""
@@ -41,6 +45,12 @@ msgid ""
41
45
"topological ordering is possible if and only if the graph has no directed "
42
46
"cycles, that is, if it is a directed acyclic graph."
43
47
msgstr ""
48
+ "拓撲排序是圖中頂點 (vertex) 的線性排序,使得對於從頂點 u 到頂點 v 的每條有向"
49
+ "邊 (directed edge) u -> v,頂點 u 在排序中會位於頂點 v 之前。例如,圖的頂點可"
50
+ "能代表要執行的任務,而邊可能代表一個任務必須在另一個任務之前執行的限制;在此"
51
+ "範例中,拓撲排序只是任務的一種有效序列。若且唯若 (if and only if) 圖沒有有向"
52
+ "環 (directed cycle) 時,即如果它是個有向無環圖 (directed acyclic graph),則完"
53
+ "整的拓撲排序才是可行的。"
44
54
45
55
#: ../../library/graphlib.rst:31
46
56
msgid ""
@@ -50,58 +60,73 @@ msgid ""
50
60
"nodes that have edges that point to the value in the key). Additional nodes "
51
61
"can be added to the graph using the :meth:`~TopologicalSorter.add` method."
52
62
msgstr ""
63
+ "如果提供了可選的 *graph* 引數,它必須是表示有向無環圖的字典,其中鍵是節點,值"
64
+ "是圖中該節點的包含所有前驅節點 (predecessor) 之可疊代物件(這些前驅節點具有指"
65
+ "向以鍵表示之節點的邊)。可以使用 :meth:`~TopologicalSorter.add` 方法將其他節"
66
+ "點新增到圖中。"
53
67
54
68
#: ../../library/graphlib.rst:37
55
69
msgid ""
56
70
"In the general case, the steps required to perform the sorting of a given "
57
71
"graph are as follows:"
58
- msgstr ""
72
+ msgstr "在一般情況下,對給定的圖執行排序所需的步驟如下: "
59
73
60
74
#: ../../library/graphlib.rst:40
61
75
msgid ""
62
76
"Create an instance of the :class:`TopologicalSorter` with an optional "
63
77
"initial graph."
64
- msgstr ""
78
+ msgstr "以選用的初始圖建立 :class:`TopologicalSorter` 的實例。 "
65
79
66
80
#: ../../library/graphlib.rst:42
67
81
msgid "Add additional nodes to the graph."
68
- msgstr ""
82
+ msgstr "在圖中新增其他節點。 "
69
83
70
84
#: ../../library/graphlib.rst:43
71
85
msgid "Call :meth:`~TopologicalSorter.prepare` on the graph."
72
- msgstr ""
86
+ msgstr "呼叫圖的 :meth:`~TopologicalSorter.prepare`。 "
73
87
74
88
#: ../../library/graphlib.rst:44
75
89
msgid ""
76
90
"While :meth:`~TopologicalSorter.is_active` is ``True``, iterate over the "
77
91
"nodes returned by :meth:`~TopologicalSorter.get_ready` and process them. "
78
92
"Call :meth:`~TopologicalSorter.done` on each node as it finishes processing."
79
93
msgstr ""
94
+ "當 :meth:`~TopologicalSorter.is_active` 為 ``True`` 時,疊代 :meth:"
95
+ "`~TopologicalSorter.get_ready` 回傳的節點並處理它們。在每個節點完成處理時呼"
96
+ "叫 :meth:`~TopologicalSorter.done`。"
80
97
81
98
#: ../../library/graphlib.rst:49
82
99
msgid ""
83
100
"In case just an immediate sorting of the nodes in the graph is required and "
84
101
"no parallelism is involved, the convenience method :meth:`TopologicalSorter."
85
102
"static_order` can be used directly:"
86
103
msgstr ""
104
+ "如果只需要立即對圖中的節點進行排序且不涉及平行性 (parallelism),則可以直接使"
105
+ "用便捷方法 :meth:`TopologicalSorter.static_order`:"
87
106
88
107
#: ../../library/graphlib.rst:60
89
108
msgid ""
90
109
"The class is designed to easily support parallel processing of the nodes as "
91
110
"they become ready. For instance::"
92
111
msgstr ""
112
+ "該類別旨在簡單支援節點準備就緒時的平行處理。例如:\n"
113
+ "\n"
114
+ "::"
93
115
94
116
#: ../../library/graphlib.rst:87
95
117
msgid ""
96
118
"Add a new node and its predecessors to the graph. Both the *node* and all "
97
119
"elements in *predecessors* must be hashable."
98
120
msgstr ""
121
+ "向圖中新增新節點及其前驅節點。*node* 和 *predecessors* 中的所有元素都必須是可"
122
+ "雜湊的。"
99
123
100
124
#: ../../library/graphlib.rst:90
101
125
msgid ""
102
126
"If called multiple times with the same node argument, the set of "
103
127
"dependencies will be the union of all dependencies passed in."
104
128
msgstr ""
129
+ "如果以相同節點引數多次呼叫,則依賴項的集合將會是傳入的所有依賴項的聯集。"
105
130
106
131
#: ../../library/graphlib.rst:93
107
132
msgid ""
@@ -110,11 +135,16 @@ msgid ""
110
135
"provided before is included among *predecessors* it will be automatically "
111
136
"added to the graph with no predecessors of its own."
112
137
msgstr ""
138
+ "可以新增一個沒有依賴關係的節點(*predecessors* 未提供)或提供兩次依賴關係。如"
139
+ "果有之前未曾提供的節點被包含在 *predecessors* 中,它將自動新增到沒有前驅節點"
140
+ "的圖中。"
113
141
114
142
#: ../../library/graphlib.rst:98
115
143
msgid ""
116
144
"Raises :exc:`ValueError` if called after :meth:`~TopologicalSorter.prepare`."
117
145
msgstr ""
146
+ "如果在 :meth:`~TopologicalSorter.prepare` 之後呼叫,則引發 :exc:"
147
+ "`ValueError`。"
118
148
119
149
#: ../../library/graphlib.rst:102
120
150
msgid ""
@@ -125,6 +155,10 @@ msgid ""
125
155
"be modified, and therefore no more nodes can be added using :meth:"
126
156
"`~TopologicalSorter.add`."
127
157
msgstr ""
158
+ "將圖標記為已完成並檢查圖中的循環。如果檢測到任何循環,將引發 :exc:"
159
+ "`CycleError`,但 :meth:`~TopologicalSorter.get_ready` 仍可用於盡可能獲得更多"
160
+ "的節點,直到循環阻塞了進度。呼叫此函式後就無法修改圖,因此無法使用 :meth:"
161
+ "`~TopologicalSorter.add` 來新增更多節點。"
128
162
129
163
#: ../../library/graphlib.rst:111
130
164
msgid ""
@@ -135,29 +169,44 @@ msgid ""
135
169
"`TopologicalSorter.done` is less than the number that have been returned by :"
136
170
"meth:`TopologicalSorter.get_ready`."
137
171
msgstr ""
172
+ "如果可以有更多進度則回傳 ``True``,否則回傳 ``False``。如果循環不阻塞解析 "
173
+ "(resolution) 並且仍有節點準備就緒但尚未由 :meth:`TopologicalSorter."
174
+ "get_ready` 回傳或標記為 :meth:`TopologicalSorter.done` 的節點數量較 :meth:"
175
+ "`TopologicalSorter.get_ready` 所回傳的少,則可以繼續取得進度。"
138
176
139
177
#: ../../library/graphlib.rst:118
140
178
msgid ""
141
179
"The :meth:`~TopologicalSorter.__bool__` method of this class defers to this "
142
180
"function, so instead of::"
143
181
msgstr ""
182
+ "此類別的 :meth:`~TopologicalSorter.__bool__` 方法遵循此函式,因此以下做法:\n"
183
+ "\n"
184
+ "::"
144
185
145
186
#: ../../library/graphlib.rst:124
146
187
msgid "it is possible to simply do::"
147
188
msgstr ""
189
+ "可以簡單地用以下方式替換:\n"
190
+ "\n"
191
+ "::"
148
192
149
193
#: ../../library/graphlib.rst:129 ../../library/graphlib.rst:152
150
194
msgid ""
151
195
"Raises :exc:`ValueError` if called without calling :meth:`~TopologicalSorter."
152
196
"prepare` previously."
153
197
msgstr ""
198
+ "如果呼叫之前沒有先呼叫 :meth:`~TopologicalSorter.prepare` 則引發 :exc:"
199
+ "`ValueError`。"
154
200
155
201
#: ../../library/graphlib.rst:134
156
202
msgid ""
157
203
"Marks a set of nodes returned by :meth:`TopologicalSorter.get_ready` as "
158
204
"processed, unblocking any successor of each node in *nodes* for being "
159
205
"returned in the future by a call to :meth:`TopologicalSorter.get_ready`."
160
206
msgstr ""
207
+ "將 :meth:`TopologicalSorter.get_ready` 回傳的一組節點標記為已處理,停止阻塞 "
208
+ "*nodes* 中每個節點的任何後繼節點 (successor),以便將來通過呼叫 :meth:"
209
+ "`TopologicalSorter.get_ready` 回傳。"
161
210
162
211
#: ../../library/graphlib.rst:138
163
212
msgid ""
@@ -167,6 +216,10 @@ msgid ""
167
216
"meth:`~TopologicalSorter.prepare` or if node has not yet been returned by :"
168
217
"meth:`~TopologicalSorter.get_ready`."
169
218
msgstr ""
219
+ "若沒有和該呼叫一起呼叫 :meth:`~TopologicalSorter.prepare` 或節點還沒有被 :"
220
+ "meth:`~TopologicalSorter.get_ready` 回傳,且如果 *nodes* 中有任何節點已被先前"
221
+ "對此方法的呼叫標記為已處理、或者未使用 :meth:`TopologicalSorter.add` 將節點新"
222
+ "增到圖中,則引發 :exc:`ValueError`。"
170
223
171
224
#: ../../library/graphlib.rst:146
172
225
msgid ""
@@ -176,6 +229,10 @@ msgid ""
176
229
"nodes that have all their predecessors already processed. Once no more "
177
230
"progress can be made, empty tuples are returned."
178
231
msgstr ""
232
+ "回傳一個包含所有準備就緒節點的 ``tuple``。最初它回傳沒有前驅節點的所有節點,"
233
+ "一旦通過呼叫 :meth:`TopologicalSorter.done` 來將這些節點標記為已處理後,進一"
234
+ "步的呼叫將回傳所有其全部前驅節點都已被處理的新節點。若無法取得更多進度,將回"
235
+ "傳空 tuple。"
179
236
180
237
#: ../../library/graphlib.rst:157
181
238
msgid ""
@@ -184,12 +241,17 @@ msgid ""
184
241
"`~TopologicalSorter.done` should not be called. This method is equivalent "
185
242
"to::"
186
243
msgstr ""
244
+ "回傳一個可疊代物件,它將按拓撲排序疊代節點。使用此方法時,不應呼叫 :meth:"
245
+ "`~TopologicalSorter.prepare` 和 :meth:`~TopologicalSorter.done`。此方法等效"
246
+ "於:\n"
247
+ "\n"
248
+ "::"
187
249
188
250
#: ../../library/graphlib.rst:169
189
251
msgid ""
190
252
"The particular order that is returned may depend on the specific order in "
191
253
"which the items were inserted in the graph. For example:"
192
- msgstr ""
254
+ msgstr "回傳的特定順序可能取決於將項目插入圖中的特定順序。例如: "
193
255
194
256
#: ../../library/graphlib.rst:186
195
257
msgid ""
@@ -198,25 +260,31 @@ msgid ""
198
260
"`~TopologicalSorter.get_ready`) and the order between them is determined by "
199
261
"the order of insertion."
200
262
msgstr ""
263
+ "這是因為 \" 0\" 和 \" 2\" 在圖中處於同一級別(它們將在對 :meth:"
264
+ "`~TopologicalSorter.get_ready` 的同一呼叫中回傳)並且它們之間的順序取決於插入"
265
+ "順序。"
201
266
202
267
#: ../../library/graphlib.rst:192
203
268
msgid "If any cycle is detected, :exc:`CycleError` will be raised."
204
- msgstr ""
269
+ msgstr "如果檢測到任何循環,則引發 :exc:`CycleError`。 "
205
270
206
271
#: ../../library/graphlib.rst:198
207
272
msgid "Exceptions"
208
273
msgstr "例外"
209
274
210
275
#: ../../library/graphlib.rst:199
211
276
msgid "The :mod:`graphlib` module defines the following exception classes:"
212
- msgstr ""
277
+ msgstr ":mod:`graphlib` 模組定義了以下例外類別: "
213
278
214
279
#: ../../library/graphlib.rst:203
215
280
msgid ""
216
281
"Subclass of :exc:`ValueError` raised by :meth:`TopologicalSorter.prepare` if "
217
282
"cycles exist in the working graph. If multiple cycles exist, only one "
218
283
"undefined choice among them will be reported and included in the exception."
219
284
msgstr ""
285
+ ":exc:`ValueError` 的子類別,如果作用的圖中有循環的存在則由 :meth:"
286
+ "`TopologicalSorter.prepare` 引發。如果存在多個循環,則只會報告未定義的其中一個"
287
+ "並包含在例外中。"
220
288
221
289
#: ../../library/graphlib.rst:207
222
290
msgid ""
@@ -226,3 +294,7 @@ msgid ""
226
294
"predecessor of the next node in the list. In the reported list, the first "
227
295
"and the last node will be the same, to make it clear that it is cyclic."
228
296
msgstr ""
297
+ "檢測到的循環可以通過例外實例的 :attr:`~CycleError.args` 屬性中第二個元素來存"
298
+ "取,其為一個節點列表,每個節點在圖中都是列表中下一個節點的直接前驅節點"
299
+ "(immediate predecessor,即父節點)。在報告列表中,第一個和最後一個節點將會是"
300
+ "相同的,用以明確表示它是循環的。"
0 commit comments