Conversion modèle BS de/en vers fr

"*", "UKRZu" => "*", "TurmHST" => "*", "BHF" => "GARE", "KBFa" => "GARTdbt", "KBFe" => "GARTfin", "HBHF" => "GARE", "BHFr" => "GARTdbt", "BHFl" => "GARTfin", "KBFl" => "GARTg", "KBFr" => "GARTd", "DST" => "GAREM", "KDSa" => "GARTMdbt", "KDSe" => "GARTMfin", "HST" => "HALTE", "HSTa" => "HALTEdbt", "HSTe" => "HALTEfin", "TurmBHFo" => "GARE+CRSs", "TurmBHFu" => "GARE+CRSi", "ABZlf" => "BIFgav", "ABZrf" => "BIFdav", "ABZlg" => "BIFgar", "ABZrg" => "BIFdar", "ABZdf" => "BIF2av", "ABZdg" => "BIF2ar", "ABZdrf" => "BIF2dav", "ABZdlf" => "BIF2gar", "ABZdrg" => "BIF2dar", "ABZdlg" => "BIF2gar", "ABZld" => "BIF2g", "ABZrd" => "BIF2d", "ABZ_ld" => "BIF2_g", "ABZ_rd" => "BIF2_d", "ABZgf" => "BIFdavar", "ABZfg" => "BIFgavar", "ABZ3lf" => "BIFdfin", "ABZ3lg" => "BIFddbt", "ABZ3rf" => "BIFgfin", "ABZ3rg" => "BIFgdbt", "ABZdl" => "*", "ABZdr" => "*", "KRZo" => "CRSs", "KRZu" => "CRSi", "KRZt" => "CRSt", "KRZ" => "CRS", "STR" => "VOIE", "STRlf" => "COURBEgav", "STRrf" => "COURBEdav", "STRlg" => "COURBEgar", "STRrg" => "COURBEdar", "BS2lf" => "*", "BS2rf" => "*", "BS2lg" => "*", "BS2rg" => "*", "BS2cro" => "*", "BS2clo" => "*", "BS2clu" => "*", "BS2cru" => "*", "BRÜCKE1" => "PONT1", "BRÜCKE2" => "PONT2", "SBRÜCKE" => "*", "WBRÜCKE" => "PONT+RIV", "WTUNNEL" => "*", "TUNNEL1" => "TUNNEL1", "TUNNEL2" => "TUNNEL2", "TUNNELa" => "TUNNELdbt", "TUNNELe" => "TUNNELfin", "KMW" => "CHGKM", "WBRÜCKE+GRENZE" => "PONT+RIV+FRONTIERE", "BRÜCKE+GRENZE" => "PONT+FRONTIERE", "BRÜCKE" => "PONT", "GRENZE" => "FRONTIERE", "AKRZo" => "PONT+AUT", "AKRZu" => "PONT-AUT", "ÜST" => "INVERSION", "BUE" => "*", "LUECKE" => "INTERRUPTION", "TRAJEKT" => "*", "ENDEa" => "*", "ENDEe" => "*", "" => ""); function bsPrefix($enPref) { switch($enPref) { case "": return "|"; case "x": return "|x"; case "t": return "|t"; case "e": return "e|"; case "ex": return "e|x"; default: echo ""; return ""; } } function splitId($rawId, $line, &$enPrefix, &$enId) { $enPrefix = ""; $enId = ""; if($rawId == "") return; if($num = preg_match("/^([a-z]*)([A-ZÜ].*)$/", $rawId, &$idcomps) != 1) { echo "
  • Attention, mauvais format d'identificateur de symbole ('$rawId') sur ligne : $line ($num matches)
  • \n"; return; } $enId = $idcomps[2]; $enPrefix = $idcomps[1]; } function procKM($kmField) { if(preg_match("/^\s*(\S+)\s*km\s*$/", $kmField, &$tab) != 1) { return $kmField; } return $tab[1]; } function procId($enId) { global $corr; if(!isset($corr[$enId]) || $corr[$enId] == "*") { echo "
  • Erreur : traduction pour l'ID '$enId' inconnue.
  • \n"; return "*"; } return $corr[$enId]; } function appendRemaining($tab, $idx) { $res = ""; for($i = $idx; $i < count($tab)-1; $i++) { $res .= $tab[$i] . "|"; } return $res . (count($tab) > $idx ? $tab[count($tab)-1] : "") . "}}\n"; } $myURL = $_SERVER["PHP_SELF"]; /* # auto-test : il ne faut pas qu'une clé soit sous-clé d'une clé ultérieure foreach($corr as $de => $fr) { $on = false; foreach($corr as $de2 => $fr2) { if($de2 == $de) $on = true; else { if($on && strpos($de2, $de) != false) { echo "

    Err : clé '$de' présente dans clé ultérieure '$de2'

    "; } } } } */ $code = stripcslashes($_POST["code"]); if(isset($_POST["code"])) { $lines = preg_split("/(\r\n)|\r|\n/", $code); echo "

    Erreurs éventuelles

    \n"; echo "

    Si des erreurs apparaissent ici, les corriger ou les signalier à l'auteur avant de passer à la suite.

    \n"; echo "\n"; echo "

    Plan de ligne avec le modèle BS français

    "; echo "

    À coller dans un article de Wikipédia en Français.

    \n"; echo "
    $res
    \n"; } ?>

    Plan de ligne original (de/en)

    Coller ici un plan de ligne récupéré sur une Wikipédia étrangère. Ne pas coller les en-têtes, mais uniquement les lignes qui commencent par {{BS....



    Outil réalisé par Christophe Jacquet. Version du 13 août 2007. Pour toute information, rapport de bug, etc., voir fr:Utilisateur:ChrisJ.