Parsing U + 00BE (¾) for a number in python
I have a string that represents an ingredient with quantity, unit, description, etc.
¾ cup fresh pineapple, cut in small chunks or canned pineapple tidbits, drained
I would like to parse this string into an object that contains all the different characteristics of this ingredient.
The problem I'm running into is that I don't know how to convert the number (¾) from the Unicode representation to a normal number.
How can I parse this sentence to get a result like 3/4 or 0.75?
+3
source to share