def pos_detect(str)
      raise ArgumentError, 'str must be a String' unless str.is_a?(String)

      j_instance.sentPosDetect(str).map do |span|
        OpenNlp::Util::Span.new(span.getStart, span.getEnd)
      end
    end
def pos_detect(str)
      raise ArgumentError, 'str must be a String' unless str.is_a?(String)

      j_instance.sentPosDetect(str).map do |span|
        OpenNlp::Util::Span.new(span.getStart, span.getEnd)
      end
    end
Detects sentences in a string and returns array of spans

 @param [String] str
 @return [Array<OpenNlp::Util::Span>] array of spans for detected sentences