MCPcopy Create free account
hub / github.com/geekcomputers/Python / word_count

Function word_count

news_oversimplifier.py:73–83  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

71
72
73def 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
86def summarize_text(text, ratio=0.6): # pytest in test file

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected