Skip to content

Commit 20dede7

Browse files
committed
Apply suggestions from code review
1 parent bfc96f2 commit 20dede7

File tree

1 file changed

+54
-45
lines changed

1 file changed

+54
-45
lines changed

library/random.po

Lines changed: 54 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ msgstr "位元組函式"
213213

214214
#: ../../library/random.rst:112
215215
msgid "Generate *n* random bytes."
216-
msgstr "產生 *n* 隨機位元組。"
216+
msgstr "產生 *n* 個隨機位元組。"
217217

218218
#: ../../library/random.rst:114
219219
msgid ""
@@ -224,15 +224,15 @@ msgstr ""
224224

225225
#: ../../library/random.rst:121
226226
msgid "Functions for integers"
227-
msgstr "整數函式"
227+
msgstr "回傳整數的函式"
228228

229229
#: ../../library/random.rst:126
230230
msgid ""
231231
"Return a randomly selected element from ``range(start, stop, step)``. This "
232232
"is equivalent to ``choice(range(start, stop, step))``, but doesn't actually "
233233
"build a range object."
234234
msgstr ""
235-
"從 ``range(start, stop, step)`` 中所回傳隨機選擇的元素。這等效於 "
235+
"從 ``range(start, stop, step)`` 中回傳一個隨機選擇的元素。這等效於 "
236236
"``choice(range(start, stop, step))``,但實際上並沒有構建範圍物件。"
237237

238238
#: ../../library/random.rst:130
@@ -268,15 +268,15 @@ msgid ""
268268
"``randrange('10')`` will be changed from :exc:`ValueError` to :exc:"
269269
"`TypeError`."
270270
msgstr ""
271-
"對於非整數值,例如 ``randrange(10.5)`` 或 ``randrange('10')``,引發的異常將"
271+
"對於非整數值,例如 ``randrange(10.5)`` 或 ``randrange('10')``,引發的例外將"
272272
"從 :exc:`ValueError` 改為 :exc:`TypeError`。"
273273

274274
#: ../../library/random.rst:150
275275
msgid ""
276276
"Return a random integer *N* such that ``a <= N <= b``. Alias for "
277277
"``randrange(a, b+1)``."
278278
msgstr ""
279-
"返回一個隨機整數 *N*,使得 ``a <= N <= b``。``randrange(a, b+1)`` 的別名。"
279+
"回傳一個隨機整數 *N*,使得 ``a <= N <= b``。``randrange(a, b+1)`` 的別名。"
280280

281281
#: ../../library/random.rst:155
282282
msgid ""
@@ -285,8 +285,8 @@ msgid ""
285285
"also provide it as an optional part of the API. When available, :meth:"
286286
"`getrandbits` enables :meth:`randrange` to handle arbitrarily large ranges."
287287
msgstr ""
288-
"回傳一個具有 *k* 隨機位的非負 Python 整數。此方法隨 MersenneTwister 與其他一"
289-
"些產生器一起提供,也可能將其作為 API 的可選部分提供。如果可用,\\ :meth:"
288+
"回傳一個具有 *k* 個隨機位元的非負 Python 整數。此方法會隨 MersenneTwister 產生器一"
289+
"起提供,一些其他的產生器也可能將其作為 API 的可選部分。如果可用,\\ :meth:"
290290
"`getrandbits` 使 :meth:`randrange` 能夠處理任意大的範圍。"
291291

292292
#: ../../library/random.rst:161
@@ -310,7 +310,7 @@ msgid ""
310310
"Return a *k* sized list of elements chosen from the *population* with "
311311
"replacement. If the *population* is empty, raises :exc:`IndexError`."
312312
msgstr ""
313-
"回傳從 *population* 中選擇的大小為 *k* 的元素清單進行替換。如果 *population* "
313+
"回傳從 *population* 中重置取樣出的一個大小為 *k* 的元素 list。如果 *population* "
314314
"為空,則引發 :exc:`IndexError`。"
315315

316316
#: ../../library/random.rst:178
@@ -337,7 +337,7 @@ msgid ""
337337
"specify both *weights* and *cum_weights*."
338338
msgstr ""
339339
"如果既未指定 *weights* 也未指定 *cum_weights*,則以相等的機率進行選擇。如果提"
340-
"供了加權序列,則該序列的長度必須與 *population* 序列的長度相同。 它是一個 :"
340+
"供了加權序列,則該序列的長度必須與 *population* 序列的長度相同。它是一個 :"
341341
"exc:`TypeError` 來指定 *weights* 和 *cum_weights*。"
342342

343343
#: ../../library/random.rst:192
@@ -348,9 +348,9 @@ msgid ""
348348
"to be non-negative and finite. A :exc:`ValueError` is raised if all weights "
349349
"are zero."
350350
msgstr ""
351-
"*weights* 或 *cum_weights* 可以使用任何 :func:`random` 所回傳的 :class:"
352-
"`float` 值(包括整數、float 和分數,但不包括小數)互操作 (interoperates) 的數"
353-
"值類型。權重假定為非負數和有限權重。如果所有權重均為零,則引發 :exc:"
351+
"*weights* 或 *cum_weights* 可以使用任何與 :func:`random` 所回傳的 :class:"
352+
"`float` 值(包括整數、float 和分數,但不包括小數)交互操作 (interoperates) 的數"
353+
"值類型。權重假定為非負數和有限的。如果所有權重均為零,則引發 :exc:"
354354
"`ValueError`。"
355355

356356
#: ../../library/random.rst:198
@@ -373,14 +373,14 @@ msgstr "如果所有權重均為零,則引發 :exc:`ValueError`。"
373373

374374
#: ../../library/random.rst:213
375375
msgid "Shuffle the sequence *x* in place."
376-
msgstr "將序列 *x* 隨機打亂位置。"
376+
msgstr "將序列 *x* 原地 (in place) 隨機打亂位置。"
377377

378378
#: ../../library/random.rst:215
379379
msgid ""
380380
"The optional argument *random* is a 0-argument function returning a random "
381381
"float in [0.0, 1.0); by default, this is the function :func:`.random`."
382382
msgstr ""
383-
"選擇性引數 *random* 是一個 0 引數函式,預設回傳一個在 [0.0, 1.0) 的隨機 "
383+
"選擇性引數 *random* 是一個 0 引數函式,回傳一個在 [0.0, 1.0) 之間的隨機 "
384384
"float;預設情況下,這是函式 :func:`.random`。"
385385

386386
#: ../../library/random.rst:218
@@ -399,8 +399,8 @@ msgid ""
399399
"generated. For example, a sequence of length 2080 is the largest that can "
400400
"fit within the period of the Mersenne Twister random number generator."
401401
msgstr ""
402-
"請注意,即使對於較小的 ``len(x)``,*x* 的排列總數也會快速成長到大於大多數隨機"
403-
"數產生器的週期。這意味著長序列的大多數排列永遠無法產生。例如,長度為 2080 的"
402+
"請注意,即使對於較小的 ``len(x)``,*x* 的置換總數也會快速成長到大於大多數隨機"
403+
"數產生器的週期。這意味著長序列的大多數置換永遠無法產生。例如,長度為 2080 的"
404404
"序列是 Mersenne Twister 隨機數產生器週期內可以容納的最大序列。"
405405

406406
#: ../../library/random.rst:228
@@ -412,7 +412,7 @@ msgid ""
412412
"Return a *k* length list of unique elements chosen from the population "
413413
"sequence or set. Used for random sampling without replacement."
414414
msgstr ""
415-
"回傳從母體序列或集合中選擇的唯一元素的 *k* 長度清單。用於隨機取樣,無需替換。"
415+
"回傳從母體序列或集合中選擇出的一個包含獨特元素、長度為 *k* 的 list。用於不重置的隨機取樣。"
416416

417417
#: ../../library/random.rst:236
418418
msgid ""
@@ -422,7 +422,7 @@ msgid ""
422422
"winners (the sample) to be partitioned into grand prize and second place "
423423
"winners (the subslices)."
424424
msgstr ""
425-
"回傳包含母體元素的新清單,同時保持原始母體不變。 產生的清單按選擇順序排列,因"
425+
"回傳包含母體元素的新清單,同時保持原始母體不變。產生的清單按選擇順序排列,因"
426426
"此所有子切片也會是有效的隨機樣本。這允許抽獎獲獎者(樣本)分為大獎和第二名獲"
427427
"獎者(子切片)。"
428428

@@ -472,8 +472,8 @@ msgid ""
472472
"`list` or :class:`tuple`, preferably in a deterministic order so that the "
473473
"sample is reproducible."
474474
msgstr ""
475-
"將來,*母體* 必須是一個序列。不再支援 :class:`set` 的實例。必須先將集合轉換"
476-
"為 :class:`list` 或 :class:`tuple`,最好是按確定性順序,以便樣本是可復現的。"
475+
"將來,*population* 必須是一個序列。不再支援 :class:`set` 的實例。必須先將集合轉換"
476+
"為 :class:`list` 或 :class:`tuple`,最好是按確定性順序,以便取樣是可復現的。"
477477

478478
#: ../../library/random.rst:270
479479
msgid "Real-valued distributions"
@@ -486,7 +486,7 @@ msgid ""
486486
"distribution's equation, as used in common mathematical practice; most of "
487487
"these equations can be found in any statistics text."
488488
msgstr ""
489-
"以下函式產生特定的實數分佈。函式參數以分佈方程中的對應變量命名,如常見的數學"
489+
"以下函式產生特定的實數分佈。函式參數以分佈方程中的對應變數命名,如常見的數學"
490490
"實踐所示;這些方程式中的大多數都可以在任意統計文本中找到。"
491491

492492
#: ../../library/random.rst:280
@@ -498,8 +498,8 @@ msgid ""
498498
"Return a random floating point number *N* such that ``a <= N <= b`` for ``a "
499499
"<= b`` and ``b <= N <= a`` for ``b < a``."
500500
msgstr ""
501-
"回傳一個隨機浮點數 *N*,使得 ``a <= N <= b`` 為 ``a <= b``、``b <= N <= a`` "
502-
"為 ``b < a``。"
501+
"回傳一個隨機浮點數 *N*, ``a <= b`` 時確保 N 為 ``a <= N <= b`` 、``b < a`` "
502+
"時確保 N 為 ``b <= N <= a``。"
503503

504504
#: ../../library/random.rst:288
505505
msgid ""
@@ -545,12 +545,15 @@ msgid ""
545545
"Gamma distribution. (*Not* the gamma function!) Conditions on the "
546546
"parameters are ``alpha > 0`` and ``beta > 0``."
547547
msgstr ""
548-
"Gamma(伽瑪)分佈。(*不是* Gamma 函式!) 參數的條件為 ``alpha > 0`` 和 "
548+
"Gamma(伽瑪)分佈。(*不是* Gamma 函式!)參數的條件為 ``alpha > 0`` 和 "
549549
"``beta > 0``。"
550550

551551
#: ../../library/random.rst:320
552552
msgid "The probability distribution function is::"
553-
msgstr "Probability distribution function(機率密度函數是)::"
553+
msgstr ""
554+
"Probability distribution function(機率密度函數)是:\n"
555+
"\n"
556+
"::"
554557

555558
#: ../../library/random.rst:329
556559
msgid ""
@@ -569,7 +572,7 @@ msgid ""
569572
"random number generator. 2) Put locks around all calls. 3) Use the slower, "
570573
"but thread-safe :func:`normalvariate` function instead."
571574
msgstr ""
572-
"多執行緒須注意:當兩個線程同時呼叫此函式時,它們可能會收到相同的傳回值。 這可"
575+
"多執行緒須注意:當兩個執行緒同時呼叫此函式時,它們可能會收到相同的傳回值。這可"
573576
"以透過三種方式避免。1)讓每個執行緒使用隨機數產生器的不同實例。2)在所有呼叫"
574577
"周圍加鎖。3)使用較慢但執行緒安全的 :func:`normalvariate` 函數代替。"
575578

@@ -580,8 +583,8 @@ msgid ""
580583
"deviation *sigma*. *mu* can have any value, and *sigma* must be greater "
581584
"than zero."
582585
msgstr ""
583-
"對數常態分佈。如果你取此分佈的自然對數,您將獲得一個具有平均數 *mu* 和標準差 "
584-
"*sigma* 的常態分佈。*mu* 可以有任何值,並且 *sigma* 必須大於零。"
586+
"對數常態分佈。如果你取此分佈的自然對數,你將獲得一個具有平均數 *mu* 和標準差 "
587+
"*sigma* 的常態分佈。*mu* 可以為任何值,並且 *sigma* 必須大於零。"
585588

586589
#: ../../library/random.rst:351
587590
msgid ""
@@ -619,7 +622,7 @@ msgstr "替代產生器"
619622
msgid ""
620623
"Class that implements the default pseudo-random number generator used by "
621624
"the :mod:`random` module."
622-
msgstr "實現 :mod:`random` 模組使用的預設偽隨機數產生器的 Class。"
625+
msgstr "實現 :mod:`random` 模組使用的預設偽隨機數產生器的 class。"
623626

624627
#: ../../library/random.rst:381
625628
msgid ""
@@ -641,7 +644,7 @@ msgid ""
641644
msgstr ""
642645
"使用 :func:`os.urandom` 函式從作業系統提供的來源產生隨機數的 Class。並非在所"
643646
"有系統上都可用。不依賴於軟體狀態,並且序列不可復現。因此 :meth:`seed` 方法沒"
644-
"有效果,而被忽略。如果呼叫 :meth:`getstate` 和 :meth:`setstate` 方法會引發 :"
647+
"有效果且被忽略。如果呼叫 :meth:`getstate` 和 :meth:`setstate` 方法會引發 :"
645648
"exc:`NotImplementedError`。"
646649

647650
#: ../../library/random.rst:397
@@ -655,7 +658,7 @@ msgid ""
655658
"should be reproducible from run to run as long as multiple threads are not "
656659
"running."
657660
msgstr ""
658-
"有時,能夠重現偽隨機數產生器給出的序列很有用。只要多線程未運行,透過重複使用"
661+
"有時,能夠重現偽隨機數產生器給出的序列很有用。只要多執行緒未運行,透過重複使用"
659662
"種子值,同一序列就應該可以被復現。"
660663

661664
#: ../../library/random.rst:403
@@ -670,7 +673,7 @@ msgstr ""
670673
msgid ""
671674
"If a new seeding method is added, then a backward compatible seeder will be "
672675
"offered."
673-
msgstr "如果增加了新的播種方法,則將提供向後相容的播種器。"
676+
msgstr "如果增加了新的 seed 設定函數,則將提供向後相容的播種器 (seeder)。"
674677

675678
#: ../../library/random.rst:409
676679
msgid ""
@@ -705,7 +708,7 @@ msgid ""
705708
"a confidence interval for the mean of a sample::"
706709
msgstr ""
707710
"`統計 bootstrapping(自助法) <https://en.wikipedia.org/wiki/"
708-
"Bootstrapping_(statistics)>`_ 的範例,使用替換重新取樣來估計樣本平均數的信賴"
711+
"Bootstrapping_(statistics)>`_\\ 的範例,使用有重置的重新取樣來估計樣本平均數的信賴"
709712
"區間 ::"
710713

711714
#: ../../library/random.rst:486
@@ -716,13 +719,17 @@ msgid ""
716719
"observed difference between the effects of a drug versus a placebo::"
717720
msgstr ""
718721
"`重新取樣排列測試 <https://en.wikipedia.org/wiki/"
719-
"Resampling_(statistics)#Permutation_tests>`_ 的範例,來確定觀察到的藥物與安慰"
720-
"劑之間差異的統計學意義或 `p值 <https://en.wikipedia.org/wiki/P-value>`_ ::"
722+
"Resampling_(statistics)#Permutation_tests>`_\\ 的範例,來確定觀察到的藥物與安慰"
723+
"劑之間差異的統計學意義或 `p 值 <https://en.wikipedia.org/wiki/P-value>`_ \n"
724+
"\n"
725+
"::"
721726

722727
#: ../../library/random.rst:513
723728
msgid ""
724729
"Simulation of arrival times and service deliveries for a multiserver queue::"
725-
msgstr "模擬多伺服器序列的到達時間與服務交付 ::"
730+
msgstr "模擬多伺服器佇列 (queue) 的到達時間與服務交付\n"
731+
"\n"
732+
"::"
726733

727734
#: ../../library/random.rst:542
728735
msgid ""
@@ -731,7 +738,7 @@ msgid ""
731738
"profile/295/>`_ on statistical analysis using just a few fundamental "
732739
"concepts including simulation, sampling, shuffling, and cross-validation."
733740
msgstr ""
734-
"`Statistics for Hackers <https://www.youtube.com/watch?v=Iq9DzN6mvYA>`_ "
741+
"`Statistics for Hackers <https://www.youtube.com/watch?v=Iq9DzN6mvYA>`_ 是由 "
735742
"`Jake Vanderplas <https://us.pycon.org/2016/speaker/profile/295/>`_ 製作的教"
736743
"學影片,僅使用幾個基本概念(包括模擬、取樣、洗牌、交叉驗證)進行統計分析。"
737744

@@ -744,8 +751,8 @@ msgid ""
744751
"choice, triangular, and randrange)."
745752
msgstr ""
746753
"`Economics Simulation <http://nbviewer.jupyter.org/url/norvig.com/ipython/"
747-
"Economics.ipynb>`_ `Peter Norvig <http://norvig.com/bio.html>`_ 對市場進行"
748-
"了模擬,顯示了該模組提供的許多工具和分佈(高斯、均勻、樣本、 beta 變數、選"
754+
"Economics.ipynb>`_\\ 是由 `Peter Norvig <http://norvig.com/bio.html>`_ 對市場進行"
755+
"的模擬,顯示了該模組提供的許多工具和分佈(高斯、均勻、樣本、 beta 變數、選"
749756
"擇,三角形、隨機數)的有效使用。"
750757

751758
#: ../../library/random.rst:555
@@ -758,12 +765,12 @@ msgid ""
758765
msgstr ""
759766
"`機率的具體介紹(使用Python) <http://nbviewer.jupyter.org/url/norvig.com/"
760767
"ipython/Probability.ipynb>`_ 為 `Peter Norvig <http://norvig.com/bio.html>`_ "
761-
"的教學課程,涵蓋了機率理論的基礎知識,如何模擬以及如何使用 Python 執行數據分"
768+
"的教學課程,涵蓋了機率理論的基礎知識與如何模擬以及使用 Python 執行數據分"
762769
"析。"
763770

764771
#: ../../library/random.rst:563
765772
msgid "Recipes"
766-
msgstr "程式庫"
773+
msgstr "使用方案"
767774

768775
#: ../../library/random.rst:565
769776
msgid ""
@@ -786,16 +793,18 @@ msgid ""
786793
"often as the next larger exponent."
787794
msgstr ""
788795
"以下範例採用不同的方法。間隔中的所有 float 都是可能的選擇。尾數來自 *2⁵² ≤ 尾"
789-
"數< 2⁵³* 範圍內的整數均勻分佈。指數來自幾何分佈,其中小於 *-53* 的指數的出現"
796+
"數 < 2⁵³* 範圍內的整數均勻分佈。指數來自幾何分佈,其中小於 *-53* 的指數的出現"
790797
"頻率是下一個較大指數的一半。"
791798

792799
#: ../../library/random.rst:593
793800
msgid ""
794801
"All :ref:`real valued distributions <real-valued-distributions>` in the "
795802
"class will use the new method::"
796803
msgstr ""
797-
"Class 中的所有 :ref:`real valued distribution <real-valued-distributions>` 都"
798-
"將使用新方法 ::"
804+
"Class 中的所有\\ :ref:`實數分佈 <real-valued-distributions>`\\ 都"
805+
"將使用新方法\n"
806+
"\n"
807+
"::"
799808

800809
#: ../../library/random.rst:602
801810
msgid ""
@@ -807,7 +816,7 @@ msgid ""
807816
msgstr ""
808817
"該範例在概念上等效於一種演算法,該演算法從 *0.0 ≤ x < 1.0* 範圍內 2⁻¹⁰⁷⁴ 的所"
809818
"有倍數中進行選擇。這些數字都是均勻分佈的,但大多數必須向下捨入到最接近的可表"
810-
"示的 Python float。( 2⁻¹⁰⁷⁴ 是最小為正的非正規化 float,等於 ``math."
819+
"示的 Python float。(2⁻¹⁰⁷⁴ 是最小為正的非正規化 float,等於 ``math."
811820
"ulp(0.0)``)"
812821

813822
#: ../../library/random.rst:611

0 commit comments

Comments
 (0)