Implement accessibility.pluralize for Finnish - #105
Conversation
…f the function This might avoid unnecessary allocations. Not sure how Typst handles this internally.
|
The second commit moves dictionary definitions out of the |
|
@Mc-Zen This might be in a usable state now. Let me know if there is something missing, although I cannot promise I can work on this after the next 30--40 minutes is gone. |
hpcfzl
left a comment
There was a problem hiding this comment.
These entries sure add to the overall length, just as a suggestion have you thought about combining str.slice and the ssa/ssä suffixes as needed?
|
Yes, deriving the denominator unit versions from the plural versions could be done with a simple rule. However, I have a different problem with the denominator versions: As I understand, they also replace the I can deal with this implementation but I have one question for @SeSodesa : what happens if multiple units are in the denominator? Like V/(m s), would that be voltti metrissä sekunnissa or does it get more complicated? If it gets more complicated, I would vote for the more generic version withthe per phrase. |
Yes, the first case would sound weird. I think the most sensible-sounding approach here would be to have "V / (m s)" or "V / m / s" read as the latter of these, as in volttia jaettuna metrillä jaettuna sekunnilla. The "jaettuna" or "divided by" kind of changes how the suffixes work again, when there are multipe units. Basically the added "ss" denotin being IN something changes to "ll" which denotes dividing BY something. But I need to check the individual cases for hanging edges. I am about to jump on a train again and might be able to set up a proposed alternative dictionary a bit later today. |
|
And I think m / s reading as "metriä jaettuna sekunnilla" is also fine, even if "metriä sekunnissa" would be the most ideal case for single-unit denominators. |
…is preceded by "per " or "jaettuna " Also note the removed 't' from voltti: the suffix might also change the number of double consonants from the basic form of the word: voltti -> voltissa or voltti -> voltilla.
|
Ok, I updated the |
|
Thank you very much! I will just add a few tests to finish up this PR. |
This is a continuation of #88. The first commit implements pluralize but is there something else that needs to get done?