Allow property usage templates of any language

- as long as it contains "Wikidata"
master
Raymon Zutekouw 2 days ago
parent 36a3093522
commit e3ae480f6b
Signed by: raymon
GPG Key ID: 0E62222846283925
  1. 2
      src/lib.rs

@ -8,7 +8,7 @@ pub mod wikipedia_infobox_analyzer {
pub fn extract_used_properties_from_template(template: String) -> Vec<String> {
let mut lines = template.lines();
let used = lines
.find(|line| line.starts_with("{{Gebruikt Wikidata"))
.find(|line| line.starts_with("{{") && line.contains("Wikidata|"))
.expect("Template should have a line declaring which properties are used");
// The properties are listed inside the template with their number: P1|P2|P...

Loading…
Cancel
Save