Add ability to have synonyms for author names and keywords

Created by: Zaharid

People seem to be very fond of adding free form keywords and authors when they upload validphys reports. This makes actually searching for something more difficult than it should. Some things tried for this that didn't work so well are:

  • Chasing people around to write the correct metadata. This has high costs and limited effectiveness.

  • Replace keywords manually with a one off script modifying the required meta.yaml files in the uplaoaded report. This has potential for mistake, even with done with a script and has side effects such as modifying the date of the index unless that is also taken care of. It is also rather annoying to do.

So we need a better solution. One possibility is to allow for defining synonyms somewhere, so that even if people decide to get creative with their names or keywords, they appear indexed uniformly. This can be done by adding to:

https://github.com/NNPDF/nnpdf/blob/master/validphys2/serverscripts/index-reports.py

the ability to read a yaml file with something like:

author_synonyms:
  - "Emmanuele Nocera": [ERN, E_Nocera, "Emanuele R. Nocera"]

keyword_synonyms:
  - "theory uncertainties": ["th uncertainties", 'th unc']

And then substituting by the canonical name.

An easy way of doing that is to build a reverse dictionary like

In [8]: {ele: canonical for spec in d['author_synonyms'] for canonical, syns in spec.items() for ele in syns}                                                                                                                                 
Out[8]: 
{'ERN': 'Emmanuele Nocera',
 'E_Nocera': 'Emmanuele Nocera',
 'Emanuele R. Nocera': 'Emmanuele Nocera'}

and then e.g. author = revmap.get(author, author).