We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
import nltk import re # Sample receipt text text = """ Walmart Date: 01/09/2024 Milk: $3.00 Bread: $2.50 Eggs: $1.75 Total: $7.25 """ # Tokenize text tokens = nltk.word_tokenize(text) # Use regex to find items and prices pattern = re.compile(r'([A-Za-z]+):\s\$(\d+\.\d{2})') matches = pattern.findall(text) # Extract data items = [{'item': match[0], 'price': float(match[1])} for match in matches] print(items)
Choices:
fetch
Resolves #4
The text was updated successfully, but these errors were encountered:
react-native
How?
Sorry, something went wrong.
No branches or pull requests
NLTK
Choices:
fetch
Resolves #4
The text was updated successfully, but these errors were encountered: