Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amounts in files affect probability of getting fortunes inside #4

Open
metarmask opened this issue Dec 25, 2016 · 2 comments
Open

Amounts in files affect probability of getting fortunes inside #4

metarmask opened this issue Dec 25, 2016 · 2 comments

Comments

@metarmask
Copy link
Contributor

metarmask commented Dec 25, 2016

Example:

Files: 2
File A: 10 fortunes
File B: 5 fortunes

P(fortune in A) = 1/2*1/10 = 1/20

P(fortune in B) = 1/2*1/5 = 2/20

@metarmask metarmask changed the title Amount in files affect probability of getting fortunes inside Amounts in files affect probability of getting fortunes inside Dec 26, 2016
@bunsenmcdubbs
Copy link

bunsenmcdubbs commented Dec 27, 2016

@metarmask you can try adding counts to the index fortune file you created in #3 and using that to even out the probabilities.

I can think of several reasons to keep the fortune files separate (potentially easier to black/whitelist certain types of fortunes, file size(?), convenience). But I think the easiest way to fix this issue is by combining all the fortunes into a single file.

@tanishq-dubey
Copy link
Owner

I think a better way than having one fortune file, due to the time it may take to load the file, is to have a metadata file that I can generate. We can then pick the fortune file using this metadata and then load the quote itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants