Returns the number of words in the given text. args: text (str): Input string to count words from. returns: int: Number of words in the string.
(text)
| 71 | |
| 72 | |
| 73 | def word_count(text): # pytest in test file |
| 74 | """ |
| 75 | Returns the number of words in the given text. |
| 76 | |
| 77 | args: |
| 78 | text (str): Input string to count words from. |
| 79 | |
| 80 | returns: |
| 81 | int: Number of words in the string. |
| 82 | """ |
| 83 | return len(text.split()) |
| 84 | |
| 85 | |
| 86 | def summarize_text(text, ratio=0.6): # pytest in test file |