HomePhabricator

Template adaptation: Implement template param name matching

Description

Template adaptation: Implement template param name matching

Algorithm:

  1. Get template data for both source and target
  2. Get aliases array for each parameter in source template, also add the param name to that and form aliases+name set
  3. For each param in target template data, form a similar set of aliases and param.
  4. Find intersection of above two sets.
  5. If the intersection set is not empty, the source param maps to the param name we located in target template data

Tests for name matching added.

TODO:

  1. Use the param mapping to build target template definition.
  2. Update tests for MWTemplate.js
  3. If template data not found, try to extract info from source code of template like we do in CX1

Bug: T162114
Change-Id: I4ea9ae0dc902fecba0d300864e40cae6595c61b6

Details

Provenance
santhoshAuthored on Sep 29 2017, 9:29 AM
NikerabbitCommitted on Oct 5 2017, 1:56 PM
Parents
rGCXS868da7f4081f: Adapt template names if present in Wikidata
Branches
Unknown
Tags
Unknown
ChangeId
I4ea9ae0dc902fecba0d300864e40cae6595c61b6