code: public static int word_count(EvaluationContext ctx, Object text, @BooleanDefault(false) Object bySpaces) {
          String _text = Conversions.toString(text, ctx);
          boolean _bySpaces = Conversions.toBoolean(bySpaces, ctx);
          return getWords(_text, _bySpaces).size();
      }
docs: Returns the number of words in the given text string