View unanswered posts | View active topics It is currently Thu Aug 22, 2019 3:13 am



← Back to the Calcudoku puzzle page




Reply to topic  [ 4 posts ] 
 hour/hours in Russian 
Author Message

Posted on: Mon Jul 29, 2019 2:41 am




Posts: 33
Location: /RU/MSK
Joined: Fri May 13, 2011 12:29 pm
 hour/hours in Russian
OK, I'm getting a bit off topic now (pnm, you can move this message to a new topic if you prefer), but while looking through the source code I saw this:
Code:
if (mu=="ru") {
if (vf==1) $("#hours_ext").html("");
else if ((vf >=2) && (vf <=4)) $("#hours_ext").html('а');
else $("#hours_ext").html('ов'); }

In the Russian language, inflection of nouns that stand next to numerals depends on the last digit of the number, not on the number itself. (Except for the numbers *11, *12, *13 and *14, which behave like 0 or 10. That is because we do not pronounce 11 as “ten-one”, we say “eleven”.)
I.e. in Russian the name of the Disney movie is not “101 Dalmatians”, but something like “101 Dalmatian” (single form), because it ends in 1.
Also: 1 Dalmatian, 21 Dalmatian, 91 Dalmatian, 9001 Dalmatian.
However: 11 Dalmatians, 111 Dalmatians, 9011 Dalmatians.

To make long story short:
0 часов
1 час
2, 3, 4 часа
5, 6, 7, 8, 9, 10 часов
(suddenly) 11 часов
(suddenly) 12, 13, 14 часов
then it keeps following the pattern:
15, 16, 17, 18, 19, 20 часов
21 час
22, 23, 24 часа
25, 26, 27, 28, 29, 30 часов
31 час
32, 33, 34 часа
etc.

Same goes about minutes, except that час is masculine and минута is feminine, so the endings are different:
Tomorrow's puzzles will appear in = Новые головоломки появятся через
0 минут
1 минуту (because in here it's accusative case; the nominative case would be 1 минута)
2, 3, 4 минуты
5, 6, 7, 8, 9, 10 минут
(suddenly) 11 минут
(suddenly) 12, 13, 14 минут
15, 16, 17, 18, 19, 20 минут
21 минуту
22, 23, 24 минуты
25, 26, 27, 28, 29, 30 минут
31 минуту
etc.

So the conditions are a bit more complex:
Behave like 1 if (lastDigit == 1) && (nextToLastDigit != 1)
Behave like 2 if (lastDigit >= 2) && (lastDigit <= 4) && (nextToLastDigit != 1)
Behave like 0 otherwise

Hope I wrote everything correctly %)

_________________
If life is a game, where are the cheat codes?


Profile WWW
Site Admin
User avatar

Posted on: Mon Jul 29, 2019 10:39 am




Posts: 111
Joined: Wed May 11, 2011 6:44 pm
Post Re: hour/hours in Russian
Thanks for this [thumbsup]


And yes, I put this in a new topic as you saw.


Profile

Posted on: Thu Aug 01, 2019 11:05 pm




Posts: 33
Location: /RU/MSK
Joined: Fri May 13, 2011 12:29 pm
Post Re: hour/hours in Russian
Great! I hereby proclaim this topic the place for discussing Russian grammar… or Russification of this website… or localizations in general… whatever [biggrin]

As to hours and minutes:
http://seizewa.ru/makeshift/calcudoku_t ... ension.htm
I know that my coding style is a total mess, but I had to make sure whether the algorithm in my first post was correct.
And, yes, it was, except that it is in fact even more complicated, since “Behave like 0” should actually be interpreted as “Take the noun in plural form, genitive case”, and “Behave like 1” means “Leave the noun in single form, but the case will depend on what came before the numeral”, etc.
You may view (and make use of) the source code, it's not obfuscated [wink]
And you know what… Looking at the amount of functions (and that's for Russian alone, while you've got… how many, seven languages perhaps?..), I figured – why not stick to abbreviations? [biggrin] “Tomorrow's puzzles will appear in 10 h 1 min” or something.

_________________
If life is a game, where are the cheat codes?


Profile WWW
User avatar

Posted on: Sat Aug 17, 2019 9:19 am




Posts: 2536
Joined: Thu May 12, 2011 11:58 pm
Post Re: hour/hours in Russian
Ok, this should be fixed now,
many thanks again for the detailed explanation [thumbsup]


Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
All forum contents © Patrick Min, and by the post authors.

Forum software phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware.