class_docstr: Determines the number of words in a string. Words are sequences of characters
  delimited by whitespace.
  
  Examples:
      >>> num_words = NumWords()
      >>> num_words(['This is a string',
      ...            'Two words',
      ...            'no-spaces',
      ...            'Also works with sentences. Second sentence!']).tolist()
      [4, 2, 1, 6]
code: def get_function(self):
      def word_counter(array):
          def _get_number_of_words(elem: Optional[str]):
              """Returns the number of words in given element,
              or pd.NA given null input"""
              if pd.isna(elem):
                  return pd.NA
              return sum(
                  1
                  for word in re.split(DELIMITERS, elem)
                  if word.strip(punctuation)
              )
  
          return array.apply(_get_number_of_words)
  
      return word_counter
  
file_path: featuretools/featuretools/primitives/standard/transform/natural_language/num_words.py
imports: import re
  from string import punctuation
  from typing import Optional
  import pandas
  from woodwork.column_schema import ColumnSchema
  from woodwork.logical_types import IntegerNullable, NaturalLanguage
  from featuretools.primitives.base import TransformPrimitive
  from featuretools.primitives.standard.transform.natural_language.constants import DELIMITERS
  from featuretools.utils.gen_utils import Library
label_desc: Use image node_id 1 for calling the NumWords obj's underlying member method code with example usage: obj.get_function() and returns: word_counter, array, sum, pd