Comments (6)
I created this beast.
The problem with the 'Bushel' is that it is completely not defined. A bushel of oats is a different weight than a bushel of wheat. The weight of a bushel of wheat is also going to vary depending on where you are. I found This site, which has some state standards that recognize some federal standards.
You also have to consider that the bushels weight assumes a specific moisture and other states of the product in certain products.
From https://www.thebalance.com/how-much-is-a-bushel-1389308
A bushel of tomatoes, for example, is supposed to weigh 56 pounds, as is a bushel of shelled corn. But if the corn is still in ears, a bushel is supposed to weigh a whopping 70 pounds. Leaves and greens take up more space with less weight, so a bushel of spinach need only be 20 pounds.
So you are looking at close to 100 usage cases for a bushel. This list would still be inaccurate in certain scenarios due to variances of the definition of a bushel of that product, and also not inclusive of all use cases.
Other options include
a measure of capacity equal to 64 US pints (equivalent to 35.2 liters), used for dry goods.
and convert it to kilograms. Or pick a common agricultural bushel, and add a disclaimer (maybe links to other bushel definitions).
I think no matter what, a disclaimer of how vague a 'bushel' is, should probably be included.
from metric_units_reddit_bot.
Yeah... I didn't realize how many kinds of bushels there were until all the farmers were upset in my reddit feedback thread, haha! I asked them if a volumetric conversion would be better, and they said no.
I feel like some simple keyword matching would help a lot, like if a post said "1 bushel of tomatoes" then we would use tomato-bushels.
Code-wise it might not be so bad if we made a object like
[
{
regex: /tomato(?:es)?/,
lbs: 56
},
{
regex: /spinach/,
lbs: 20
},
{
regex: function(inputString) {
return inputString.match("ear") && inputString.match("corn");
},
lbs: 70
}
...
]
But yes, it might be a fair bit of work to take into account ALL the bushel types... hmm. Maybe we can just start with a few, and then expand our bushel-recognition slowly? Is this a task you would like to continue, or are you sick of dealing with bushels? :o)
from metric_units_reddit_bot.
I'd like to give it a shot, but don't know how much time I'll have to devote to it. If anyone else wants to as well (It is hacktoberfest), I won't be offended. I think there is enough work and edge cases to keep multiple contributors busy.
from metric_units_reddit_bot.
@MFogleman Maybe you can do 2-3 bushel numbers to get the ball rolling, and I can make issues afterwards for other people to add more bushel types? If you get too busy just give me a shout here and I can try to find someone else to do it. Thank you!! :)
from metric_units_reddit_bot.
Hey @MFogleman, we have just added a CONTRIBUTING.md doc, please check it out when you have time! Sections "Etiquette", "Work on an issue" and "Make a PR" are most important
from metric_units_reddit_bot.
I'm going to temporarily remove bushels from all conversions to solve this issue for now, an issue can be opened later on to fix it "properly," taking into account keywords :)
from metric_units_reddit_bot.
Related Issues (20)
- Refactor number parsing HOT 1
- Bug report: Add ignore keywords to "cups" for gaming sub reddits
- Feature request: Add unit `qt` = 1/4 gallon HOT 3
- Range conversion "30-50lb" converted to "30 lb50 lb ≈ 1423 kg"
- Scan the r/homebrewing thread and post constructive feedback in r/metric_units HOT 2
- Move documentation to /docs folder HOT 5
- bot off HOT 1
- Discussion - Discussions HOT 2
- Handle commas better HOT 16
- Always add L/100km conversion
- "oz" is not being converted to "troy oz" in subreddit /r/Pmsforsale HOT 27
- Ignore all nba subreddits for mpg HOT 10
- Ignore "cup" measurements over 100 HOT 2
- Feature request: Convert lbs/inch to kg/mm and N/m HOT 4
- Handle close numbers better HOT 1
- Conversions architecture overhaul
- Modify pressureMap to convert 10^5 pa to bar HOT 4
- Improve rounding HOT 4
- Bot should sass users who edit their comments to remove values HOT 7
- change footer links and text HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from metric_units_reddit_bot.