Skip to content

Commit e2be520

Browse files
committed
#898 - remove fuzzy flags
1 parent 653264c commit e2be520

File tree

1 file changed

+64
-10
lines changed

1 file changed

+64
-10
lines changed

library/heapq.po

+64-10
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ msgstr ""
1717
"Generated-By: Babel 2.17.0\n"
1818

1919
#: ../../library/heapq.rst:2
20-
#, fuzzy
2120
msgid ":mod:`!heapq` --- Heap queue algorithm"
22-
msgstr ":mod:`heapq` --- 힙 큐 알고리즘"
21+
msgstr ":mod:`!heapq` --- 힙 큐 알고리즘"
2322

2423
#: ../../library/heapq.rst:12
2524
msgid "**Source code:** :source:`Lib/heapq.py`"
@@ -36,21 +35,19 @@ msgid ""
3635
"Heaps are binary trees for which every parent node has a value less than "
3736
"or equal to any of its children. We refer to this condition as the heap "
3837
"invariant."
39-
msgstr ""
38+
msgstr "힙은 모든 부모 노드가 자식보다 작거나 같은 값을 갖는 이진 트리입니다. 이 조건을 힙 불변성이라고 합니다."
4039

4140
#: ../../library/heapq.rst:22
42-
#, fuzzy
4341
msgid ""
4442
"This implementation uses arrays for which ``heap[k] <= heap[2*k+1]`` and "
4543
"``heap[k] <= heap[2*k+2]`` for all *k*, counting elements from zero. For"
4644
" the sake of comparison, non-existing elements are considered to be "
4745
"infinite. The interesting property of a heap is that its smallest "
4846
"element is always the root, ``heap[0]``."
4947
msgstr ""
50-
"힙은 모든 부모 노드가 자식보다 작거나 같은 값을 갖는 이진 트리입니다. 이 구현에서는 모든 *k*\\에 대해 ``heap[k] "
51-
"<= heap[2*k+1]``\\과 ``heap[k] <= heap[2*k+2]``\\인 배열을 사용합니다, 요소는 0부터 셉니다."
52-
" 비교를 위해, 존재하지 않는 요소는 무한으로 간주합니다. 힙의 흥미로운 특성은 가장 작은 요소가 항상 루트인 "
53-
"``heap[0]``\\이라는 것입니다."
48+
"이 구현에서는 모든 *k*\\에 대해 ``heap[k] <= heap[2*k+1]``\\과 ``heap[k] <= "
49+
"heap[2*k+2]``\\인 배열을 사용합니다, 요소는 0부터 셉니다. 비교를 위해, 존재하지 않는 요소는 무한으로 간주합니다. "
50+
"힙의 흥미로운 특성은 가장 작은 요소가 항상 루트인 ``heap[0]``\\이라는 것입니다."
5451

5552
#: ../../library/heapq.rst:28
5653
msgid ""
@@ -255,6 +252,14 @@ msgid ""
255252
">>> heapsort([1, 3, 5, 7, 9, 2, 4, 6, 8, 0])\n"
256253
"[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]"
257254
msgstr ""
255+
">>> def heapsort(iterable):\n"
256+
"... h = []\n"
257+
"... for value in iterable:\n"
258+
"... heappush(h, value)\n"
259+
"... return [heappop(h) for i in range(len(h))]\n"
260+
"...\n"
261+
">>> heapsort([1, 3, 5, 7, 9, 2, 4, 6, 8, 0])\n"
262+
"[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]"
258263

259264
#: ../../library/heapq.rst:153
260265
msgid ""
@@ -281,6 +286,13 @@ msgid ""
281286
">>> heappop(h)\n"
282287
"(1, 'write spec')"
283288
msgstr ""
289+
">>> h = []\n"
290+
">>> heappush(h, (5, 'write code'))\n"
291+
">>> heappush(h, (7, 'release product'))\n"
292+
">>> heappush(h, (1, 'write spec'))\n"
293+
">>> heappush(h, (3, 'create tests'))\n"
294+
">>> heappop(h)\n"
295+
"(1, 'write spec')"
284296

285297
#: ../../library/heapq.rst:169
286298
msgid "Priority Queue Implementation Notes"
@@ -348,6 +360,13 @@ msgid ""
348360
" priority: int\n"
349361
" item: Any=field(compare=False)"
350362
msgstr ""
363+
"from dataclasses import dataclass, field\n"
364+
"from typing import Any\n"
365+
"\n"
366+
"@dataclass(order=True)\n"
367+
"class PrioritizedItem:\n"
368+
" priority: int\n"
369+
" item: Any=field(compare=False)"
351370

352371
#: ../../library/heapq.rst:203
353372
msgid ""
@@ -400,6 +419,33 @@ msgid ""
400419
" return task\n"
401420
" raise KeyError('pop from an empty priority queue')"
402421
msgstr ""
422+
"pq = [] # l힙에 배치된 항목의 리스트\n"
423+
"entry_finder = {} # 작업에서 항목으로의 매핑\n"
424+
"REMOVED = '<removed-task>' # 삭제된 작업을 위한 자리 표시기\n"
425+
"counter = itertools.count() # 고유한 시퀀스 카운트\n"
426+
"\n"
427+
"def add_task(task, priority=0):\n"
428+
" '새 작업을 추가하거나 기존 작업의 우선순위를 갱신합니다'\n"
429+
" if task in entry_finder:\n"
430+
" remove_task(task)\n"
431+
" count = next(counter)\n"
432+
" entry = [priority, count, task]\n"
433+
" entry_finder[task] = entry\n"
434+
" heappush(pq, entry)\n"
435+
"\n"
436+
"def remove_task(task):\n"
437+
" '기존 작업을 REMOVED로 표시합니다. 발견되지 않으면 KeyError를 발생시킵니다.'\n"
438+
" entry = entry_finder.pop(task)\n"
439+
" entry[-1] = REMOVED\n"
440+
"\n"
441+
"def pop_task():\n"
442+
" '가장 낮은 우선순위 작업을 삭제하고 반환합니다. 비어있으면 KeyError를 발생시킵니다.\n"
443+
" while pq:\n"
444+
" priority, count, task = heappop(pq)\n"
445+
" if task is not REMOVED:\n"
446+
" del entry_finder[task]\n"
447+
" return task\n"
448+
" raise KeyError('pop from an empty priority queue')"
403449

404450
#: ../../library/heapq.rst:241
405451
msgid "Theory"
@@ -437,6 +483,15 @@ msgid ""
437483
"\n"
438484
"15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30"
439485
msgstr ""
486+
"0\n"
487+
"\n"
488+
" 1 2\n"
489+
"\n"
490+
" 3 4 5 6\n"
491+
"\n"
492+
" 7 8 9 10 11 12 13 14\n"
493+
"\n"
494+
"15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30"
440495

441496
#: ../../library/heapq.rst:261
442497
msgid ""
@@ -457,7 +512,6 @@ msgstr ""
457512
"포함하지만, 위의 셀은 아래의 두 셀에 \"이기는\" 것입니다."
458513

459514
#: ../../library/heapq.rst:270
460-
#, fuzzy
461515
msgid ""
462516
"If this heap invariant is protected at all time, index 0 is clearly the "
463517
"overall winner. The simplest algorithmic way to remove it and find the "
@@ -470,7 +524,7 @@ msgstr ""
470524
"이 힙 불변성이 항상 보호된다면, 인덱스 0은 분명히 최종 승자입니다. 이것을 제거하고 \"다음\" 승자를 찾는 가장 간단한 "
471525
"알고리즘 적인 방법은 어떤 패자(위의 도표에서 셀 30이라고 합시다)를 0 위치로 옮기고, 불변성을 다시 만족할 때까지 값을 "
472526
"교환하면서 이 새로운 0을 트리 아래로 침투시키는 것입니다. 이것은 트리의 총 항목 수에 대해 분명히 로그 "
473-
"함수적(logarithmic)입니다. 모든 항목에 대해 반복하면, O(n log n) 정렬을 얻게 됩니다."
527+
"함수적(logarithmic)입니다. 모든 항목에 대해 반복하면, *O*\\ (*n* log *n*) 정렬을 얻게 됩니다."
474528

475529
#: ../../library/heapq.rst:277
476530
msgid ""

0 commit comments

Comments
 (0)