Skip to content

Commit

Permalink
Improved Wikipedia template parsing.
Browse files Browse the repository at this point in the history
  • Loading branch information
joto committed Nov 27, 2016
1 parent 0e68656 commit 5623f19
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sources/wiki/get_wiki_data.rb
Expand Up @@ -276,8 +276,11 @@ def parse_template_related_term(template, level, db)
def parse_template_wikipedia(template, level, db)
lang = template.parameters[0]
title = template.parameters[1]
if lang == ''
lang = 'en'
end
puts "#{ " " * level }Wikipedia link: lang='#{lang}' title='#{title}'"
if LANGUAGE_CODE.match(lang)
if lang == 'commons' || LANGUAGE_CODE.match(lang)
if defined?(@key)
db.execute("INSERT INTO tag_page_wikipedia_links (key, value, lang, title) VALUES (?, ?, ?, ?)", [@key, @value, lang, title])
elsif defined?(@rtype)
Expand Down

0 comments on commit 5623f19

Please sign in to comment.