Skip to content

Commit

Permalink
fix: wordcloud example
Browse files Browse the repository at this point in the history
  • Loading branch information
terryyz committed May 9, 2024
1 parent 9382184 commit e0641ef
Show file tree
Hide file tree
Showing 5 changed files with 978 additions and 978 deletions.
8 changes: 4 additions & 4 deletions data/clean/f_103_armel.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ def f_103(text):
- matplotlib.pyplot
Example:
>>> f_103('Visit https://www.python.org for more info. Python is great. I love Python.')
<wordcloud.WordCloud object at ...>
>>> f_103('Check out this link: http://www.example.com. Machine learning is fascinating.')
<wordcloud.WordCloud object at ...>
>>> print(f_103('Visit https://www.python.org for more info. Python is great. I love Python.').words_)
{'Python': 1.0, 'Visit': 0.5, 'info': 0.5, 'great': 0.5, 'love': 0.5}
>>> print(f_103('Check out this link: http://www.example.com. Machine learning is fascinating.').words_)
{'Check': 1.0, 'link': 1.0, 'Machine': 1.0, 'learning': 1.0, 'fascinating': 1.0}
"""
# Remove URLs
text = re.sub(r"http[s]?://\S+", "", text)
Expand Down
8 changes: 4 additions & 4 deletions data/processed/35_w_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ def task_func(text):
- matplotlib.pyplot
Example:
>>> task_func('Visit https://www.python.org for more info. Python is great. I love Python.')
<wordcloud.WordCloud object at ...>
>>> task_func('Check out this link: http://www.example.com. Machine learning is fascinating.')
<wordcloud.WordCloud object at ...>
>>> print(task_func('Visit https://www.python.org for more info. Python is great. I love Python.').words_)
{'Python': 1.0, 'Visit': 0.5, 'info': 0.5, 'great': 0.5, 'love': 0.5}
>>> print(task_func('Check out this link: http://www.example.com. Machine learning is fascinating.').words_)
{'Check': 1.0, 'link': 1.0, 'Machine': 1.0, 'learning': 1.0, 'fascinating': 1.0}
"""
text = re.sub(r"http[s]?://\S+", "", text)
if not text.strip(): # Check if text is not empty after URL removal
Expand Down
8 changes: 4 additions & 4 deletions data/raw/f_103_armel.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ def f_103(text):
- matplotlib.pyplot
Example:
>>> f_103('Visit https://www.python.org for more info. Python is great. I love Python.')
<wordcloud.WordCloud object at ...>
>>> f_103('Check out this link: http://www.example.com. Machine learning is fascinating.')
<wordcloud.WordCloud object at ...>
>>> print(f_103('Visit https://www.python.org for more info. Python is great. I love Python.').words_)
{'Python': 1.0, 'Visit': 0.5, 'info': 0.5, 'great': 0.5, 'love': 0.5}
>>> print(f_103('Check out this link: http://www.example.com. Machine learning is fascinating.').words_)
{'Check': 1.0, 'link': 1.0, 'Machine': 1.0, 'learning': 1.0, 'fascinating': 1.0}
"""
# Remove URLs
text = re.sub(r"http[s]?://\S+", "", text)
Expand Down
Loading

0 comments on commit e0641ef

Please sign in to comment.