[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-i18n-doc
Subject:    Re: Migrating Pology to Python 3
From:       Adrian Chaves <adrian () chaves ! io>
Date:       2022-10-08 15:11:59
Message-ID: 1fcebc0718c07c37aa9ec9323de80445 () chaves ! io
[Download RAW message or body]

This is caused by 
https://kingant.net/2019/01/rounding-numbers-in-python-2-and-python-3/

When plural forms are found, the average is calculated and rounded. In 
Python 2, round(2.5) is 3, in Python 3 round(2.5) is 2.

I have no strong opinion on the matter, but I am slightly inclined to 
keep the Python 3 behavior on this.

On 2022-10-08 13:31, Adrian Chaves wrote:

> I think the number of characters may be OK. Before it must have been 
> counting bytes, i.e. counting `É` as 2.
> 
> I will look into the word counting.
> 
> On 2022-10-08 13:13, Karl Ove Hufthammer wrote:
> Adrian Chaves skreiv 04.10.2022 12:49:
> So I would like every Pology user to test as soon as possible their 
> usual workflows with pology with the python3 branch, and report to me 
> any issue. I do expect there to be issues. So send me a command to 
> reproduce the issue you get, and I will fix it.
> 
> This is a minor bug, posieve stats seems to count the number of words 
> and characters in a different way now. Example:
> 
> msgid "One Selected File"
> msgid_plural "%1 Selected Files"
> msgstr[0] "Éi merkt fil"
> msgstr[1] "%1 merkte filer"
> 
> Python 2 'posieve stats' reports:
> 
> - msgmsg/totw-orw/tot-orw-trch-orch-tr
> translated      1    100.0%      3     100.0%      3      14      11
> 
> In other words, three English words (w-or) and 14 English characters 
> (ch-or).
> 
> While Python 3 'posieve stats' reports:
> 
> - msgmsg/totw-orw/tot-orw-trch-orch-tr
> translated      1    100.0%      2     100.0%      2      14      10
> 
> So 2 English words instead of 3, but the same number of English 
> characters (14). However, for the translations, the number of 
> characters also shrink, from 11 to 10 (and the number of words from 3 
> to 2).
> 
> I think both statistics are wrong. There are clearly 5 (or 6) English 
> words.
[Attachment #3 (unknown)]

<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" \
/></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'> \
<p>This is caused by <a \
href="https://kingant.net/2019/01/rounding-numbers-in-python-2-and-python-3/">https://kingant.net/2019/01/rounding-numbers-in-python-2-and-python-3/</a></p>
 <p>When plural forms are found, the average is calculated and rounded. In Python 2, \
round(2.5) is 3, in Python 3 round(2.5) is 2.</p> <p>I have no strong opinion on the \
matter, but I am slightly inclined to keep the Python 3 behavior on this.</p> <p \
id="reply-intro">On 2022-10-08 13:31, Adrian Chaves wrote:</p> <blockquote \
type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0"> <div \
id="replybody1"> <div style="font-size: 10pt; font-family: \
Verdana,Geneva,sans-serif;"> <p>I think the number of characters may be OK. Before it \
must have been counting bytes, i.e. counting `<span style="white-space: \
nowrap;">&Eacute;</span>` as 2.</p> <p>I will look into the word counting.</p>
<p id="v1reply-intro">On 2022-10-08 13:13, Karl Ove Hufthammer wrote:</p>
<blockquote style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0;">
<div class="v1pre" style="margin: 0; padding: 0; font-family: monospace;"><span \
style="white-space: nowrap;">Adrian&nbsp;Chaves&nbsp;skreiv&nbsp;04.10.2022&nbsp;12:49:</span>
 <blockquote style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0;"><br \
/>So I would like every Pology user to test as soon as possible their usual workflows \
with pology with the python3 branch, and report to me any issue. I do expect there to \
be issues. So send me a command to reproduce the issue you get, and I will fix it.<br \
/><br /></blockquote> This is a minor bug, posieve stats seems to count the number of \
words and characters in a different way now. Example:<br /><br /><span \
style="white-space: nowrap;">msgid&nbsp;"One&nbsp;Selected&nbsp;File"</span><br \
/><span style="white-space: \
nowrap;">msgid_plural&nbsp;"%1&nbsp;Selected&nbsp;Files"</span><br /><span \
style="white-space: nowrap;">msgstr[0]&nbsp;"&Eacute;i&nbsp;merkt&nbsp;fil"</span><br \
/><span style="white-space: \
nowrap;">msgstr[1]&nbsp;"%1&nbsp;merkte&nbsp;filer"</span><br /><br /><span \
style="white-space: nowrap;">Python&nbsp;2&nbsp;&lsquo;posieve&nbsp;stats&rsquo;&nbsp;reports:</span><br \
/><br /><span style="white-space: \
nowrap;">-&nbsp;msgmsg/totw-orw/tot-orw-trch-orch-tr</span><br /><span \
style="white-space: nowrap;">translated&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbs \
p;&nbsp;&nbsp;100.0%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp \
;100.0%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;14&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;11</span><br \
/><br />In other words, three English words (w-or) and 14 English characters \
(ch-or).<br /><br /><span style="white-space: \
nowrap;">While&nbsp;Python&nbsp;3&nbsp;&lsquo;posieve&nbsp;stats&rsquo;&nbsp;reports:</span><br \
/><br /><span style="white-space: \
nowrap;">-&nbsp;msgmsg/totw-orw/tot-orw-trch-orch-tr</span><br /><span \
style="white-space: nowrap;">translated&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbs \
p;&nbsp;&nbsp;100.0%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp \
;100.0%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;14&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;10</span><br \
/><br />So 2 English words instead of 3, but the same number of English characters \
(14). However, for the translations, the number of characters also shrink, from 11 to \
10 (and the number of words from 3 to 2).<br /><br /><span style="white-space: \
nowrap;">I&nbsp;think&nbsp;both&nbsp;statistics&nbsp;are&nbsp;wrong.&nbsp;There&nbsp;are&nbsp;clearly&nbsp;5&nbsp;(or&nbsp;6)&nbsp;English&nbsp;words.</span><br \
/><br /></div> </blockquote>
<p><br /></p>
</div>
</div>
</blockquote>
<p><br /></p>

</body></html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic