User:Edgars2007/Grammar

I have "switched" Latvian to simple foo, just not to freak you out. In reality of course there are different words in there. And don't try to ease this tree seeing that the endings for words are almost the same - it is just an coincidence.

If you don't want to count, there is 6 cases in the inner switch (without the #default), only for second one it should accept g and ģ (of course, both cases is OK), every other are only one accepting value.

If those invalid parameters are hard to detect, then it's ok - I can live without that - in that case simply return empty string.

And little example, how it looks like in reality

So the code in Lua what I have in my non-Lua-coder mind (for those first two rows of example2), is:

What would return:


 * -> Februārim

Some more testcases:


 * -> Februārim
 * -> Februāra
 * (just making sure, everything with encoding is ok) -> Februāra
 * (both are out of range) -> Invalid first and second parameter
 * (second is out of range) -> Invalid second parameter
 * (first is out of range) -> Invalid first parameter

Note. I have included  in the outer switch because there can be also alphabetical values, not only numbers, so yes -   is needed.