ryanclanigan / messaging-bridge

MIT License
0 stars 0 forks source link

Add rarity table for word selection #8

Open ryanclanigan opened 4 years ago

Aqua-duck commented 4 years ago

Would it be possible for us to make it so that users can run a command to add a new verb + weight using the discord bot (or both, if its possible on messenger)? E.g. I type something like !adverb pooped 0.3 to add "pooped" to the table with a probability of 30%

ryanclanigan commented 4 years ago

Oooh that's an interesting idea. The only problem is that by saying you give something a 30% of happening, what does that mean for the other words that already have rarities. Ideally it would also have a way to remove words as well. That would tie in with my idea of making the starting list be an editable file.

Perhaps you can give each phrase an arbitrary value? And that determines how likely it actually is.

On Tue, Jul 14, 2020 at 1:24 PM Aqua-duck notifications@github.com wrote:

Would it be possible for us to make it so that users can run a command to add a new verb + weight using the discord bot (or both, if its possible on messenger)? E.g. I type something like !adverb pooped 0.3 to add "pooped" to the table with a probability of 30%

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/ryanclanigan/messaging-bridge/issues/8#issuecomment-658394404, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHTM464UUG65BSFWOYDAVP3R3S5HHANCNFSM4OXM3DFA .

Aqua-duck commented 4 years ago

Yeah the method of assigning weight to the values can be different, I just used percentages as an example. Preface: I don't know if this is bad practice or would lead to performance issues. But maybe we could just assign each phrase an integer and that translates to how frequently it would "appear" in the list when it's searched by the random function.

E.g. !adverb poop 5 makes it so that "pooped" would effectively be 5x more likely than a phrase with a value of 1

And yes, a way to remove phrases would also be very useful. As a supplement to that we could have a command that prints the current list of phrases along with their weights