osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Implement C's Switch in Python 3 [OT languages]


Am 04.02.19 um 04:11 schrieb DL Neil: > On 4/02/19 10:00 AM, Christian 
Gollwitzer wrote:
>> Am 03.02.19 um 09:32 schrieb DL Neil:
>>> Now back to ordinal dates - the "st", "th", etc suffixes only work in 
>>> English. You'd need another list (but no great coding complexity) to 
>>> cope with a second, third, ... language!
>>
>> Only for some languages. In other languages there can be, for example, 
>> cases (inflections). Then the suffix not only depends on the number, 
>> but also on the case, which is governed by e.g. a preposition or the 
>> use in the sentence. Slavic languages have 6 or 7 cases.
> 
> I was unaware of that - not having had to cope with any of the Slavic 
> languages, to-date. Are multiple cases/inflections used for dates? 
> French has two, including both male and female ordinals, but only one 
> applies to dates!
> 

There is good and bad news ;) Bad news first: The Slavic languages have 
a noun inflection system close to the Proto-Indoeuropean one. There are 
3 genders (male, female, neutral), two numbers (singular, plural) and 6 
or 7 cases, depending on the language (indicating the function, 
nominative = subject, accusative = mostly object, locative = indicating 
a position in space, ....).

A numeral or ordinal can/must take any of those 3x2x7 forms in 
accordance to the noun it refers to.

Now the good news: for dates usually there is a fixed format which 
significantly reduces this. I am fluent in Czech, and there, almost 
exclusively the genitve case is used for dates.

"prvniho cervence", literally translating "of the first July", is used 
almost anywhere, like
"at the first of July", "prvniho cervence"
"until the first of July" = "az do prvniho cervence",
"from the first of July on" = "od prvnhio cervence".

Only in rare circumstances, the first case is used

"Prvni cervenec je den meho narozeni" = "the first of July is my birthday"

Now the even better news: In written form, spelling out the ordinals is 
very unusual. Usually, it is just indicated by a period, so all of the 
above could be written "1. 6.". This is also the standard way to write 
it in German. But it becomes a mess if you want to attach the day of the 
week, because then you need to take into account the preposition and the 
position in the sentence.


I think English is quite "unique" with writing out the ending of the 
ordinals attached to arabic numerals.


> However, such limitation also applies to the 'case solution', and worse, 
> if that additional language/those languages' exceptions apply to 
> different values, eg 1st, 11th, 2nd, 3rd which are "hard-coded" in the 
> English convention.

yes of course. True I18N is very hard, I'm glad that we just don't need 
to do it ;)


	Christian