Commit 6391d404 authored by Michael Witrant's avatar Michael Witrant

fix language

parent fbc3f716
......@@ -48,14 +48,6 @@ European Fashion Council: !ruby/struct:Answer
languages:
- en
"": !ruby/struct:Answer
name: ""
files:
- https://circabc.europa.eu/d/d/workspace/SpacesStore/318e33ff-694a-4485-9755-dde97697d148/fast.pdf
annexes: []
languages:
- fast
Voez: !ruby/struct:Answer
name: Voez
files:
......@@ -338,7 +330,7 @@ Aepoc: !ruby/struct:Answer
annexes: []
languages:
- " en"
- en
Rim: !ruby/struct:Answer
name: Rim
files:
......@@ -676,6 +668,14 @@ Faep: !ruby/struct:Answer
languages:
- en
Fast: !ruby/struct:Answer
name: Fast
files:
- https://circabc.europa.eu/d/d/workspace/SpacesStore/318e33ff-694a-4485-9755-dde97697d148/fast.pdf
annexes: []
languages: []
Danish Patent Agents Association: !ruby/struct:Answer
name: Danish Patent Agents Association
files:
......
......@@ -20,13 +20,23 @@ files.each do |type|
name = CGI::unescape(name)
#name = Iconv.iconv("utf-8", "iso8859-15", name).first
names = name.split("_")
language = names.pop
language = names.last.dup
language.gsub!(/\s/, "")
if language.size == 2
names.pop
else
language = nil
end
annex = names.index { |part| part =~ /^annex/ }
if annex
names[annex..-1] = []
end
raise "no name on #{url}" if names.empty?
name = names.map(&:capitalize).join(" ")
#name = "#{name} (#{language})"
......@@ -36,8 +46,10 @@ files.each do |type|
else
answer.files << url
end
answer.languages << language
answer.languages.uniq!
if language
answer.languages << language
answer.languages.uniq!
end
end
answers.sort.each do |name, answer|
......
---
Uk: !ruby/struct:Answer
name: Uk
files:
- https://circabc.europa.eu/d/d/workspace/SpacesStore/6436e9a1-1ba6-414e-af8c-d50fa3ac2c52/uk_governement.pdf
annexes: []
languages:
- governement
"": !ruby/struct:Answer
name: ""
files:
- https://circabc.europa.eu/d/d/workspace/SpacesStore/4edaf82a-d143-4a07-9880-e59529afc595/france.pdf
annexes: []
languages:
- france
Portugal: !ruby/struct:Answer
name: Portugal
files:
......@@ -105,6 +89,14 @@ Italy Office Of The Prime Minister: !ruby/struct:Answer
languages:
- it
France: !ruby/struct:Answer
name: France
files:
- https://circabc.europa.eu/d/d/workspace/SpacesStore/4edaf82a-d143-4a07-9880-e59529afc595/france.pdf
annexes: []
languages: []
Finnish Commerce Federation: !ruby/struct:Answer
name: Finnish Commerce Federation
files:
......@@ -212,6 +204,14 @@ Czech Republic: !ruby/struct:Answer
languages:
- en
Uk Governement: !ruby/struct:Answer
name: Uk Governement
files:
- https://circabc.europa.eu/d/d/workspace/SpacesStore/6436e9a1-1ba6-414e-af8c-d50fa3ac2c52/uk_governement.pdf
annexes: []
languages: []
Germany: !ruby/struct:Answer
name: Germany
files:
......
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