2 ms·
You're simplifying things. Please remember that in many languages the form of the numeral depends not only on the number, but also on what it is you're counting
by jwr 16y ago
You're simplifying things. Please remember that in many languages the form of the numeral depends not only on the number, but also on what it is you're counting. And you don't always know that if you're deep inside a library.
In general, there is no easy way out — and you have to allow for exceptions. Please see my other comment, about an architectural takeaway.
- Nitramp 16y agoLike I said, I understand and appreciate that arbitrary functions are required for a complete solution. I just think that this kind of matching would be a solution for a subset of problems (languages) large enough to make it useful.
- Natsu 16y ago> Please remember that in many languages the form of the numeral depends not only on the number, but also on what it is you're counting. And you don't always know that if you're deep inside a library. Japanese, for example: http://en.wikipedia.org/wiki/Japanese_counter_word http://en.wikipedia.org/wiki/Japanese_counter_word Take the counter 本, for a commonly-used example. That's used for: "Long, thin objects: rivers, roads, train tracks, ties, pencils, bottles, guitars; also, metaphorically, telephone calls, train or bus routes, movies (see also: tsūwa), points or bounds in sports events. Although 本 also means "book", the counter for books is satsu (冊)."
- Vivtek 16y agoBut doesn't the counter always follow the numeral in a non-declined manner in Japanese? That is, a pattern like "%n-satsu book" would work, right? I thought of Japanese, too, but I think maybe this is a pattern that is the inverse of the problem discussed.
- Natsu 16y agoSo long as you know what you're counting, you're fine, yes. But the real problem is that we have a different problem in each language. Every single language has its own way to do things and that's where we run into trouble, because you need generic ways of doing things and there really isn't one for all languages. You essentially need one function to create text for each language, even though some of them can share helper functions, like that one for numerals.
- Vivtek 16y agoOh - I'm not doubting the original point! I'm a professional translator myself. I know how weird it can get (most of my languages are Germanic and Romance and provide no great headaches, but Hungarian is hard to translate well).