// Updates parameters in Infobox rugby biography. Archived for historical reasons. It works only for dead persons. Modifications are needed to living persons.

	private static readonly Regex Templ = Tools.NestedTemplateRegex(new List<string>("Infobox rugby biography".Split(',')));
	public string ProcessArticle(string ArticleText, string ArticleTitle, int wikiNamespace, out string Summary, out bool Skip)
        {
            Skip = false;
            Summary = "";
		
	      foreach(Match m in Templ.Matches(ArticleText))
        	{
                string TemplCall = m.Value, newValue = m.Value;
 
                        newValue = Tools.RenameTemplateParameter(newValue, "birthname", "birth_name");
                        newValue = Tools.RenameTemplateParameter(newValue, "dateofbirth", "birth_date");
                        newValue = Tools.RenameTemplateParameter(newValue, "dateofdeath", "death_date");
                        newValue = Tools.RenameTemplateParameter(newValue, "placeofbirth", "birth_place");
                        newValue = Tools.RenameTemplateParameter(newValue, "placeofdeath", "death_place");
                        newValue = Tools.RenameTemplateParameter(newValue, "url", "website");
                        newValue = Tools.RenameTemplateParameter(newValue, "URL", "website");
			string birthyear = Tools.GetTemplateParameterValue(TemplCall, "birthyear");
			string birthmonth = Tools.GetTemplateParameterValue(TemplCall, "birthmonth");
			string birthday = Tools.GetTemplateParameterValue(TemplCall, "birthday");
			if (birthyear.Length+birthmonth.Length+birthday.Length==0)
			{
                        newValue = Tools.RemoveTemplateParameter(newValue, "birthyear");
                        newValue = Tools.RemoveTemplateParameter(newValue, "birthmonth");
                        newValue = Tools.RemoveTemplateParameter(newValue, "birthday");
			}
			string birth_date = Tools.GetTemplateParameterValue(TemplCall, "birth_date");
			if (birth_date.Length==0)
			{
                        newValue = Tools.RemoveTemplateParameter(newValue, "birth_date");
 			}
			string birthdate = "{{Birth date|"+birthyear+"|"+birthmonth+"|"+birthday+"|df=yes}}";
			if (birthyear.Length*birthmonth.Length*birthday.Length>0)
			{
                        newValue = Tools.AppendParameterToTemplate(newValue, "birth_date",birthdate,false);
                        newValue = Tools.RemoveTemplateParameter(newValue, "birthyear");
                        newValue = Tools.RemoveTemplateParameter(newValue, "birthmonth");
                        newValue = Tools.RemoveTemplateParameter(newValue, "birthday");
			}
			string deathyear = Tools.GetTemplateParameterValue(TemplCall, "deathyear");
			string deathmonth = Tools.GetTemplateParameterValue(TemplCall, "deathmonth");
			string deathday = Tools.GetTemplateParameterValue(TemplCall, "deathday");
			if (deathyear.Length+deathmonth.Length+deathday.Length==0)
			{
                        newValue = Tools.RemoveTemplateParameter(newValue, "deathyear");
                        newValue = Tools.RemoveTemplateParameter(newValue, "deathmonth");
                        newValue = Tools.RemoveTemplateParameter(newValue, "deathday");
			}
			string death_date = Tools.GetTemplateParameterValue(TemplCall, "death_date");
			if (death_date.Length==0)
			{
                        newValue = Tools.RemoveTemplateParameter(newValue, "death_date");
 			}
			string deathdate = "{{death date and age|"+deathyear+"|"+deathmonth+"|"+deathday+"|"+birthyear+"|"+birthmonth+"|"+birthday+"|df=yes}}";
			if (deathyear.Length*deathmonth.Length*deathday.Length>0)
			{
			newValue = Tools.AppendParameterToTemplate(newValue, "death_date",deathdate,false);
                        newValue = Tools.RemoveTemplateParameter(newValue, "deathyear");
                        newValue = Tools.RemoveTemplateParameter(newValue, "deathmonth");
                        newValue = Tools.RemoveTemplateParameter(newValue, "deathday");
			}
            ArticleText = ArticleText.Replace(m.Value, newValue);
	}
            return ArticleText;
        }