Swiddis / word-debt-bot

A Discord bot for running a little reading game.
MIT License
2 stars 2 forks source link

(Should we?) Add units other than words #44

Closed azhitian closed 4 months ago

azhitian commented 5 months ago

It's not very fair that languages are advantaged or disadvantaged based on how long or short their words are. For example, there's about 1.5 Mandarin characters per English word. That means Mandarin learners are earning about 1.5 as many cranes for the same material an English learner reads

A couple downsides are it adds complexity to the codebase and for the players

If implemented, different units would earn cranes at different rates, and players should be able to choose a default unit with the config commands specified in #35

You could also have some commands that are aliases for log [num_words] [genre] [unit] .hanzi = log [num_words] [genre] hanzi .kanji .hours (for audiobooks if #4 ever happens) .words

Alternatively, if you wanted to track units per language (since e.g. Russian words are on average longer than English): .english .chinese .russian

And you could also a user specify a default language with #35

Swiddis commented 5 months ago

I want to I think have units before genres, though it makes figuring out what a unit/genre is nontrivial. I like the idea of per-language or per-unit commands, that's fun, although once the count of languages gets sufficiently high I might like it less. My instinct is to take two genre fields and convert the first one to a unit if it falls in a list, could be easy to throw in a dict:

units = {
  "words": 1.0,
  "hanzi": 1.5,
  "kanji": 2.0, # Side note: dislike this when kana are also counted,
                # originally I wanted to just use "zi" and "ji".
  "hours": 8000.0,
}

scale_factor, genre = units.get(genre1, 1.0), genre1 if genre1 not in units else genre2
game.log(amount / scale_factor, genre)

I also was thinking about whether we should adjust for translation expansion of words. Translated German texts have roughly 1:1 word counts (within 10%), but they end up 30% longer from word length. I'm probably okay going without it, but we also don't yet have any players playing a language with lots of agglutination. Maybe add a way for players to define a custom scale factor (without a PR)?