@@ -17,20 +17,20 @@ msgstr ""
17
17
"Generated-By : Babel 2.17.0\n "
18
18
19
19
#: ../../library/graphlib.rst:2
20
- #, fuzzy
21
20
msgid ":mod:`!graphlib` --- Functionality to operate with graph-like structures"
22
- msgstr ":mod:`graphlib` --- 그래프와 유사한 구조에 작동하는 기능"
21
+ msgstr ":mod:`! graphlib` --- 그래프와 유사한 구조에 작동하는 기능"
23
22
24
23
#: ../../library/graphlib.rst:8
25
24
msgid "**Source code:** :source:`Lib/graphlib.py`"
26
25
msgstr "**소스 코드:** :source:`Lib/graphlib.py`"
27
26
28
27
#: ../../library/graphlib.rst:20
29
- #, fuzzy
30
28
msgid ""
31
29
"Provides functionality to topologically sort a graph of :term:`hashable` "
32
30
"nodes."
33
- msgstr "해시 가능 노드의 그래프(graph)를 위상 정렬(topological sort)하는 기능을 제공합니다."
31
+ msgstr ""
32
+ ":term:`해시 가능 <hashable>` 노드의 그래프(graph)를 위상 정렬(topological sort)하는 기능을 "
33
+ "제공합니다."
34
34
35
35
#: ../../library/graphlib.rst:22
36
36
msgid ""
@@ -110,6 +110,10 @@ msgid ""
110
110
">>> tuple(ts.static_order())\n"
111
111
"('A', 'C', 'B', 'D')"
112
112
msgstr ""
113
+ ">>> graph = {\" D\" : {\" B\" , \" C\" }, \" C\" : {\" A\" }, \" B\" : {\" A\" }}\n"
114
+ ">>> ts = TopologicalSorter(graph)\n"
115
+ ">>> tuple(ts.static_order())\n"
116
+ "('A', 'C', 'B', 'D')"
113
117
114
118
#: ../../library/graphlib.rst:60
115
119
msgid ""
@@ -143,15 +147,32 @@ msgid ""
143
147
" node = finalized_tasks_queue.get()\n"
144
148
" topological_sorter.done(node)"
145
149
msgstr ""
150
+ "topological_sorter = TopologicalSorter()\n"
151
+ "\n"
152
+ "# 'topological_sorter' 에 노드를 추가합니다...\n"
153
+ "\n"
154
+ "topological_sorter.prepare()\n"
155
+ "while topological_sorter.is_active():\n"
156
+ " for node in topological_sorter.get_ready():\n"
157
+ " # 작업자 스레드나 프로세스는 'task_queue' 큐에서 작업할 노드를 꺼냅니다.\n"
158
+ " task_queue.put(node)\n"
159
+ "\n"
160
+ " # 노드의 작업이 완료되면, 작업자는 노드를 'finalized_tasks_queue' 에 넣어서\n"
161
+ " # 작업할 더 많은 노드를 얻을 수 있도록 합니다. 'is_active()'의 정의는, 이 시점에서,\n"
162
+ " # 아직 'done()'으로 전달되지 않은 하나 이상의 노드가 'task_queue'에 있다고 보장해서,\n"
163
+ " # 이 블로킹 'get()'은 (결국) 성공합니다. 'done()'을 호출한 후, 다시 'get_ready()'를\n"
164
+ " # 호출하도록 루프로 돌아가서, 새로 풀려난 노드를 논리적으로 가능한 한 빨리 'task_queue'에\n"
165
+ " # 넣습니다.\n"
166
+ " node = finalized_tasks_queue.get()\n"
167
+ " topological_sorter.done(node)"
146
168
147
169
#: ../../library/graphlib.rst:87
148
- #, fuzzy
149
170
msgid ""
150
171
"Add a new node and its predecessors to the graph. Both the *node* and all"
151
172
" elements in *predecessors* must be :term:`hashable`."
152
173
msgstr ""
153
- "새 노드와 그 선행 노드를 그래프에 추가합니다. *node*\\ 와 *predecessors*\\ 의 모든 요소는 모두 해시 가능해야 "
154
- "합니다."
174
+ "새 노드와 그 선행 노드를 그래프에 추가합니다. *node*\\ 와 *predecessors*\\ 의 모든 요소는 모두 "
175
+ ":term:`해시 가능 <hashable>` \\ 해야 합니다."
155
176
156
177
#: ../../library/graphlib.rst:90
157
178
msgid ""
@@ -204,17 +225,18 @@ msgstr ""
204
225
":meth:`TopologicalSorter.get_ready`\\ 에 의해 반환된 수보다 작으면 진행할 수 있습니다."
205
226
206
227
#: ../../library/graphlib.rst:118
207
- #, fuzzy
208
228
msgid ""
209
229
"The :meth:`~object.__bool__` method of this class defers to this "
210
230
"function, so instead of::"
211
- msgstr "이 클래스의 :meth:`~TopologicalSorter .__bool__` 메서드는 이 함수로 위임됩니다, 그래서 다음 대신::"
231
+ msgstr "이 클래스의 :meth:`~object .__bool__` 메서드는 이 함수로 위임됩니다, 그래서 다음 대신::"
212
232
213
233
#: ../../library/graphlib.rst:121
214
234
msgid ""
215
235
"if ts.is_active():\n"
216
236
" ..."
217
237
msgstr ""
238
+ "if ts.is_active():\n"
239
+ " ..."
218
240
219
241
#: ../../library/graphlib.rst:124
220
242
msgid "it is possible to simply do::"
@@ -225,6 +247,8 @@ msgid ""
225
247
"if ts:\n"
226
248
" ..."
227
249
msgstr ""
250
+ "if ts:\n"
251
+ " ..."
228
252
229
253
#: ../../library/graphlib.rst:129 ../../library/graphlib.rst:152
230
254
msgid ""
@@ -271,15 +295,15 @@ msgstr ""
271
295
"처리된 모든 새 노드를 반환합니다. 더는 진행할 수 없으면, 빈 튜플이 반환됩니다."
272
296
273
297
#: ../../library/graphlib.rst:157
274
- #, fuzzy
275
298
msgid ""
276
299
"Returns an iterator object which will iterate over nodes in a topological"
277
300
" order. When using this method, :meth:`~TopologicalSorter.prepare` and "
278
301
":meth:`~TopologicalSorter.done` should not be called. This method is "
279
302
"equivalent to::"
280
303
msgstr ""
281
- "위상 순서로 노드의 이터러블을 반환합니다. 이 메서드를 사용하면 :meth:`TopologicalSorter.prepare`\\ 나 "
282
- ":meth:`TopologicalSorter.done`\\ 을 호출할 필요가 없습니다. 이 방법은 다음과 동등합니다::"
304
+ "노드들을 위상 순서로 이터레이트하는 이터레이터 객체를 반환합니다. 이 메서드를 사용할 때, "
305
+ ":meth:`~TopologicalSorter.prepare`\\ 와 :meth:`~TopologicalSorter.done`\\ 은 "
306
+ "호출하지 않아야 합니다. 이 메서드는 다음과 동등합니다::"
283
307
284
308
#: ../../library/graphlib.rst:162
285
309
msgid ""
@@ -290,6 +314,12 @@ msgid ""
290
314
" yield from node_group\n"
291
315
" self.done(*node_group)"
292
316
msgstr ""
317
+ "def static_order(self):\n"
318
+ " self.prepare()\n"
319
+ " while self.is_active():\n"
320
+ " node_group = self.get_ready()\n"
321
+ " yield from node_group\n"
322
+ " self.done(*node_group)"
293
323
294
324
#: ../../library/graphlib.rst:169
295
325
msgid ""
@@ -311,6 +341,17 @@ msgid ""
311
341
">>> print([*ts2.static_order()])\n"
312
342
"[0, 2, 1, 3]"
313
343
msgstr ""
344
+ ">>> ts = TopologicalSorter()\n"
345
+ ">>> ts.add(3, 2, 1)\n"
346
+ ">>> ts.add(1, 0)\n"
347
+ ">>> print([*ts.static_order()])\n"
348
+ "[2, 0, 1, 3]\n"
349
+ "\n"
350
+ ">>> ts2 = TopologicalSorter()\n"
351
+ ">>> ts2.add(1, 0)\n"
352
+ ">>> ts2.add(3, 2, 1)\n"
353
+ ">>> print([*ts2.static_order()])\n"
354
+ "[0, 2, 1, 3]"
314
355
315
356
#: ../../library/graphlib.rst:186
316
357
msgid ""
@@ -347,7 +388,6 @@ msgstr ""
347
388
"예외에 포함됩니다."
348
389
349
390
#: ../../library/graphlib.rst:207
350
- #, fuzzy
351
391
msgid ""
352
392
"The detected cycle can be accessed via the second element in the "
353
393
":attr:`~BaseException.args` attribute of the exception instance and "
@@ -356,7 +396,7 @@ msgid ""
356
396
" the first and the last node will be the same, to make it clear that it "
357
397
"is cyclic."
358
398
msgstr ""
359
- "감지된 순환은 예외 인스턴스의 :attr:`~CycleError .args` 속성에서 두 번째 요소를 통해 액세스 할 수 있으며 각 "
360
- "노드가 그래프에서 리스트에 있는 다음 노드의 직전 선행 노드가 되도록 노드 리스트로 구성됩니다. 보고된 리스트에서, 순환임을 분명히 "
361
- " 하기 위해, 처음과 마지막 노드는 같습니다."
399
+ "감지된 순환은 예외 인스턴스의 :attr:`~BaseException .args` 어트리뷰트에서 두 번째 요소를 통해 액세스 할 수 "
400
+ "있으며 각 노드가 그래프에서 리스트에 있는 다음 노드의 직전 선행 노드가 되도록 노드 리스트로 구성됩니다. 보고된 리스트에서, "
401
+ "순환임을 분명히 하기 위해, 처음과 마지막 노드는 같습니다."
362
402
0 commit comments