def detect(tokens)
      raise ArgumentError, 'tokens must be an instance of Array' unless tokens.is_a?(Array)

      j_instance.find(tokens.to_java(:String)).to_ary
    end
def detect(tokens)
      raise ArgumentError, 'tokens must be an instance of Array' unless tokens.is_a?(Array)

      j_instance.find(tokens.to_java(:String)).to_ary
    end
Detects names for provided array of tokens

 @param [Array<String>] tokens tokens to run name detection on
 @return [Array<Java::opennlp.tools.util.Span>] names detected