parameters: (self, ref_or_cat, lang="he", dependents_regex=None)
docstring: :param ref_or_cat:
          :param lang:
          :param dependents_regex: string - filter dependents by those that have this string (treat this as a category))
          :return:
docstring_summary: :param ref_or_cat:
          :param lang:
          :param dependents_regex: string - filter dependents by those that have this string (treat this as a category))
          :return:
docstring_tokens: : param ref_or_cat : : param lang : : param dependents_regex : string - filter dependents by those that have this string ( treat this as a category )) : return :
function: def word_count(self, ref_or_cat, lang="he", dependents_regex=None):
          """
          :param ref_or_cat:
          :param lang:
          :param dependents_regex: string - filter dependents by those that have this string (treat this as a category))
          :return:
          """
          if isinstance(ref_or_cat, Ref):
              return ref_or_cat.word_count(lang)
          try:
              return Ref(ref_or_cat).word_count(lang)
          except InputError:
              if dependents_regex:
                  raw_ins = library.get_indexes_in_category(ref_or_cat, True)
                  ins = filter(lambda s: re.search(dependents_regex,s), raw_ins)
              else:
                  ins = library.get_indexes_in_category(ref_or_cat)
              return sum([Ref(r).word_count(lang) for r in ins])
function_tokens: def word_count ( self , ref_or_cat , lang = "he" , dependents_regex = None ) : if isinstance ( ref_or_cat , Ref ) : return ref_or_cat . word_count ( lang ) try : return Ref ( ref_or_cat ) . word_count ( lang ) except InputError : if dependents_regex : raw_ins = library . get_indexes_in_category ( ref_or_cat , True ) ins = filter ( lambda s : re . search ( dependents_regex , s ) , raw_ins ) else : ins = library . get_indexes_in_category ( ref_or_cat ) return sum ( [ Ref ( r ) . word_count ( lang ) for r in ins ] )