| Wiktionary:Information desk Dec 5th 2012, 04:28 How to count in German: how to count _0_, and the presence or absence of 'und' | ← Older revision | Revision as of 04:28, 5 December 2012 | | Line 1,628: | Line 1,628: | | | :My suggestion: | | :My suggestion: | | | * First set the code up to recognise the German terms for 1 (eins) through 20 (zwanzig) and for every 'round ten' (30, 40, 50, 60, 70, 80, 90). Then, whenever a two-digit number is given that is not one of those numbers, convert its ones digit to the appropriate term (e.g. 6 becomes sechs) and follow that name with 'und' with no spaces before or after it (unless it is 0 or 1: those are special cases) and convert the tens digit to the appropriate round ten (e.g. 2_ becomes zwanzig). | | * First set the code up to recognise the German terms for 1 (eins) through 20 (zwanzig) and for every 'round ten' (30, 40, 50, 60, 70, 80, 90). Then, whenever a two-digit number is given that is not one of those numbers, convert its ones digit to the appropriate term (e.g. 6 becomes sechs) and follow that name with 'und' with no spaces before or after it (unless it is 0 or 1: those are special cases) and convert the tens digit to the appropriate round ten (e.g. 2_ becomes zwanzig). | | − | * If the one-digit number 0 is put in, recognise it as 'null'. If a more-than-one digit number is put in and the digit in the ones place is 0, ignore it and do not use 'und', either. Thus 22 becomes 'zweiundzwanzig' but 20 becomes 'zwanzig' (not 'nullundzwanzig' nor 'undzwanzig'). | + | * If the one-digit number 0 is put in, recognise it as 'null'. If a more-than-one digit number is put in and the digit in the ones place is 0, ignore it and do not use 'und', either. Thus 42 becomes 'zweiundvierzig' but 40 becomes 'vierzig' (not 'nullundvierzig' nor 'undvierzig'). | | | * If a more-than-one digit number is put in and the digit in the ones place is 1, recognise the 1 as 'ein'. Thus 21 becomes 'einundzwanzig' not 'einsundzwanzig'. | | * If a more-than-one digit number is put in and the digit in the ones place is 1, recognise the 1 as 'ein'. Thus 21 becomes 'einundzwanzig' not 'einsundzwanzig'. | | | * Next, set the code up to recognise hundreds by doing something like this: | | * Next, set the code up to recognise hundreds by doing something like this: | | − | *: Either: if there is any number other than zero if the hundreds digit (e.g. if the input is 120, 346, 982, etc), add 'hundert' to the front of whatever the result of your parsing of the tens and ones digits is, and add something in front of hundert based on ''which'' digit is in the hundreds place: 'ein' for 1 (a special case), and 'zwei' for 2, 'drei' for 3, etc (identical to the terms used for those digits when they appear as the ones digit). | + | *: Either: if there is any number other than zero in the hundreds digit (e.g. if the input is 120, 346, 982, etc), add 'hundert' to the front of whatever the result of your parsing of the tens and ones digits is, and add something in front of 'hundert' based on ''which'' digit is in the hundreds place: 'ein' (or nothing) for 1 (a special case either way), and 'zwei' for 2, 'drei' for 3, etc (identical to the terms used for those digits when they appear as the ones digit). | | − | *: Or: hard-code all ten possible digits: if there is a 1 in the hundreds place, pre-pend 'einhundert', if there is a 2 pre-pend 'zweihundert', etc. If the number in the hundreds place is 0, ignore it. | + | *: Or: hard-code all ten possible digits: if there is a 1 in the hundreds place, pre-pend 'einhundert', if there is a 2 pre-pend 'zweihundert', etc. If the number in the hundreds place is 0, ignore it. (You may also add 'und' after '...hundert'; see below.) | | | :This should work for all numbers up to 999. [[User:-sche|- -sche]] [[User talk:-sche|(discuss)]] 20:16, 4 December 2012 (UTC) | | :This should work for all numbers up to 999. [[User:-sche|- -sche]] [[User talk:-sche|(discuss)]] 20:16, 4 December 2012 (UTC) | | | + | ::Oh, regarding cases where the tens digit of a three digit number of blank: to me, 'einhundertundeins' is the most proper term for '101', but 'einhunderteins' is also OK; 'hunderteins' and 'hundertundeins' are also encountered. Pick one and be consistent, i.e. always go with 'einhundert' or always 'hundert' for the numbers 100-199, always omit 'und' or never omit it from three-digit numbers. Another _0_ example: 206 is 'zweihundert[und]sechs'. Compare 122, which can be 'einhundertundzweiundzwanzig', 'einhundertzweiundzwanzig', 'hundertundzweiundzwanzig', 'hundertzweiundzwanzig'. [[User:-sche|- -sche]] [[User talk:-sche|(discuss)]] 04:28, 5 December 2012 (UTC) | | | :: @-sche Don't do his homework for him. He needed to know how to count in German but the rest should be up to him. --[[User:Wikitiki89|Wiki]][[User talk:Wikitiki89|Tiki]][[Special:Contributions/Wikitiki89|89]] 20:20, 4 December 2012 (UTC) | | :: @-sche Don't do his homework for him. He needed to know how to count in German but the rest should be up to him. --[[User:Wikitiki89|Wiki]][[User talk:Wikitiki89|Tiki]][[Special:Contributions/Wikitiki89|89]] 20:20, 4 December 2012 (UTC) | | |
沒有留言:
張貼留言