<commit_before>module IRail::NMBS
  class DocumentParser
    STATION_XPATH = "//station"

    def self.parse_stations(xml_string)
      xml_payload  = Nokogiri::XML(xml_string)
      xml_stations = xml_payload.xpath(STATION_XPATH)
      xml_stations.inject([]) do |stations, xml_station|
        stations << IRail::NMBS::Station.from_xml(xml_station.to_s)
      end
    end
  end
end<commit_msg>Extract method in nmbs document parser<commit_after>module IRail::NMBS
  class DocumentParser
    STATION_XPATH = "//station"

    def self.parse_stations(xml_string)
      xml_stations(xml_string).inject([]) do |stations, xml_station|
        stations << IRail::NMBS::Station.from_xml(xml_station.to_s)
      end
    end

    def self.xml_stations(xml_string)
      xml_payload = Nokogiri::XML(xml_string)
      xml_payload.xpath(STATION_XPATH)
    end
  end
end
{'fraction_non_alphanumeric': 0.0979020979020979, 'fraction_numerical': 0.0, 'mean_word_length': 3.772222222222222, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 20}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1688406', 'n_tokens_mistral': 304, 'n_tokens_neox': 298, 'n_words': 50}