Utilisateur:ZX81-bot/Journaux/2007061601

Une page de Wikipédia, l'encyclopédie libre.

Stérilité humaine[modifier | modifier le code]

Début : 16/06/2007 15:50:35
Fin : 16/06/2007 16:20:32
Historique : Special:Contributions/ZX81-bot

Mode : automatique

Outil utilisé : AutoWikiBrowser version 3.9.2.0

Options AWB activées :

  • Apply general fixes
  • Unicodify whole article


Expressions rationnelles utilisées pour les remplacements de texte :

  • s/(?<=\[\[)[ _]*(Stérilité)[ _]*(?=\]\])/Stérilité humaine|$1/i
  • s/(?<=\[\[)[ _]*Stérilité[ _]*(?=\|[^]]*\]\])/Stérilité humaine/i


Catégorie Essai francophone remplacée par catégorie Essai de langue française

Module activé :

        public string ProcessArticle(string ArticleText, string ArticleTitle, int wikiNamespace, out string Summary, out bool Skip)
        {
            Skip = false;
            Summary = "";
 
            ArticleText = Regex.Replace(ArticleText,
                @"(?<=\[\[)[ _]*" +
                @"(?:" + Variables.LangCode.ToString().ToLower() + @"[ _]*:[ _]*)?" +
                @"(?:Category|" + Variables.Namespaces[14].Replace(":", "") + @")[ _]*:[ _]*" +
                @"(?=[^\]]+\]\])",
                Variables.Namespaces[14], RegexOptions.IgnoreCase);
            ArticleText = Regex.Replace(ArticleText,
                @"(?<=\[\[" +
                Variables.Namespaces[14] +
                @")\p{Ll}",
                new MatchEvaluator(UpFirstChar));

            ArticleText = Regex.Replace(ArticleText,
                @"(?<=\{\{)[ _]*DEFAULTSORT[ _]*:[ _]*([^\}]*?)[ _]*(?=\}\})",
                new MatchEvaluator(Key),
                RegexOptions.IgnoreCase);
            ArticleText = Regex.Replace(ArticleText,
                @"(?<=\{\{DEFAULTSORT:[^\}]*\}\})\s*(?=\[\[" +
                Variables.Namespaces[14] +
                @")",
                "\r\n",
                RegexOptions.Singleline);

            return ArticleText;
        }

        private string UpFirstChar(Match m)
        {
            return m.Value.ToUpper();
        }

        private string CleanKey(string key)
        {
            key = Regex.Replace(key.Replace("_"," "), @" +", " ");
 
            string[] tr1 = new string[48] { "0⅛¼⅜⅝⅞½¾٠۰", "1١۱", "2٢۲", "3٣۳", "4٤۴", "5٥۵", "6٦۶", "7٧۷", "8٨۸", "9٩۹", "aáàâãäåăąā", "AÁÀÂÃÄÅĂĄĀ", "cçćĉčċ", "CÇĆĈČĊ", "dðďđ", "DÐĎĐ", "eéèêëěėęē", "EÉÈÊËĚĖĘĒ", "gğĝġģ", "GĞĜĠĢ", "hĥħ", "HĤĦ", "iíìîïıĩįī", "IÍÌÎÏİĨĮĪ", "jĵ", "JĴ", "kĸķ", "KĶ", "lĺľłļŀ", "LĹĽŁĻĿ", "nñʼnńňņ", "NÑŃŇŅ", "oóòôõöøőō", "OÓÒÔÕÖØŐŌ", "rŕřŗ", "RŔŘŖ", "sśŝšş", "SŚŜŠŞ", "tťŧţ", "TŤŦŢ", "uúùûüŭůűũųū", "UÚÙÛÜŬŮŰŨŲŪ", "wŵ", "WŴ", "yýÿŷ", "YÝŶŸ", "zźžż", "ZŹŽŻ" };
            string[] tr2 = new string[8] { "aeæ", "AEÆ", "oeœ", "OEŒ", "ssß", "ijij", "ngŋ", "NGŊ" };
 
            foreach (string t in tr1)
            {
                key = Regex.Replace(key, @"[" + t.Substring(1) + @"]", t.Substring(0, 1));
            }
            foreach (string t in tr2)
            {
                key = Regex.Replace(key, @"[" + t.Substring(2) + @"]", t.Substring(0, 2));
            }
 
            return key;
        }
 
        private string Key(Match m)
        {
            return "DEFAULTSORT:" + CleanKey(m.Groups[1].Value);
        }



Articles non modifiés :