MCPcopy Create free account
hub / github.com/Paper2Poster/Paper2Poster / count_words

Function count_words

utils/poster_eval_utils.py:649–657  ·  view source on GitHub ↗

Count the number of words in a given text string. :param text: Input text :return: Number of words found

(text)

Source from the content-addressed store, hash-verified

647 return len(enc.encode(text))
648
649def count_words(text):
650 """
651 Count the number of words in a given text string.
652 :param text: Input text
653 :return: Number of words found
654 """
655 # Use a regex to find word-like sequences
656 words = re.findall(r"\w+", text)
657 return len(words)
658
659
660def count_words_in_image(image_path):

Callers 1

count_words_in_imageFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected