Hugging Face
Models
Datasets
Spaces
Buckets
new
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
Ramkan7
/
Patch_Hawk
like
0
Running
App
Files
Files
Community
Fetching metadata from the HF Docker repository...
main
Patch_Hawk
/
patchhawk
/
data
/
benign
/
str_wordcount.py
RAMCr7
Final patch
58f6308
about 1 month ago
raw
Copy download link
history
blame
contribute
delete
Safe
197 Bytes
def
word_count
(
text
):
"""Count occurrences of words in text."""
words = text.split()
counts = {}
for
word
in
words:
counts[word] = counts.get(word,
0
) +
1
return
counts