Commit c557a385 authored by Michael Witrant's avatar Michael Witrant

debut extraction

parent 90d2a375
#!/usr/bin/env ruby
data = File.read('Amdts_spectre_1.txt')
# <Amend>Amendment <NumAm>74 + +</NumAm>
# <Members>Lena Kolarska-Bobińska</Members>
# <DocAmend>Proposal for a decision</DocAmend>
# <Article>Recital 7 </Article>
#
# Text proposed by the Commission
# Amendment
# (7) Ensuring the optimal use of spectrum may require innovative authorisation solutions such as collective use of spectrum, general authorisations or infrastructure sharing. The application of such principles in the Union might be facilitated by the definition of certain common or converging conditions for spectrum usage. General authorisations, which are the least onerous authorisation system, are of particular interest where interference does not risk hampering the development of other services.
# (7) Ensuring the optimal use of spectrum as a public good may require innovative authorisation solutions such as collective use of spectrum, general authorisations or infrastructure sharing. The application of such principles in the Union might be facilitated by the definition of certain common or converging conditions for spectrum usage. General authorisations, which are the least onerous authorisation system, are of particular interest where interference does not risk hampering the development of other services.
# Or. <Original>{EN}en</Original>
# </Amend>
require 'rubygems'
require 'pp'
require 'nokogiri'
sections = data.scan(%r(<Amend>.+?</Amend>)m)
amendements = sections.map do |xml|
doc = Nokogiri::XML(xml)
num, note = doc.css('NumAm').text.split(' ', 2)
note.gsub!(/\s/, '') if note
{
:num => num,
:note => note,
:members => doc.css('Members').text,
}
end
puts amendements.to_yaml
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment