<commit_before><?php

class ExportLiaisonsCSV {

    protected $etablissement = null;
    protected $header = false;

    public static function getHeaderCsv() {
        return "identifiant etablissement source;nom etablissement source;cvi etablissement source;ppm etablissement source;liaison type;identifiant etablissement lié;nom etablissement lié;cvi etablissement lié;ppm etablissement lié;hash chais lié; attribus chais liés;aliases;liaison doc id;doc id;id/hash liaisons\n";
    }

    public function __construct($header = true) {
        $this->header = $header;
    }

    public function getFileName() {

        return $this->doc->_id . '_' . $this->doc->_rev . '.csv';
    }

    public function protectStr($str) {
    	return str_replace('"', '', $str);
    }

    protected function formatFloat($value) {

        return str_replace(".", ",", $value);
    }

    public function exportAll() {
        $csv = "";
        if ($this->header) {
            $csv .= $this->getHeaderCsv();
        }
        foreach(EtablissementAllView::getInstance()->getAll() as $json_doc) {
            $etablissement = EtablissementClient::getInstance()->find($json_doc->id);
            foreach($etablissement->liaisons_operateurs as $k => $liaison) {
                $csv .= $etablissement->identifiant.";";
                $csv .= $etablissement->nom.";";
                $csv .= $etablissement->cvi.";";
                $csv .= $etablissement->ppm.";";
                $csv .= $liaison->type_liaison.";";
                $csv .= preg_replace('/ETABLISSEMENT-/', '', $liaison->id_etablissement).";";
                $csv .= $liaison->libelle_etablissement.";";
                $csv .= $liaison->cvi.";";
                $csv .= $liaison->ppm.";";
                $csv .= $liaison->hash_chai.";";
                $csv .= ";"; // attributs chais
                $csv .= ";"; // aliaises
                $csv .= $liaison->id_etablissement.";";
                $csv .= $etablissement->_id;
                $csv .= $etablissement->_id.'/'.$k;
                $csv .= "\n";
            }
        }
        return $csv;
    }

}<commit_msg>spérateur pour le dernier champs<commit_after><?php

class ExportLiaisonsCSV {

    protected $etablissement = null;
    protected $header = false;

    public static function getHeaderCsv() {
        return "identifiant etablissement source;nom etablissement source;cvi etablissement source;ppm etablissement source;liaison type;identifiant etablissement lié;nom etablissement lié;cvi etablissement lié;ppm etablissement lié;hash chais lié; attribus chais liés;aliases;liaison doc id;doc id;id/hash liaisons\n";
    }

    public function __construct($header = true) {
        $this->header = $header;
    }

    public function getFileName() {

        return $this->doc->_id . '_' . $this->doc->_rev . '.csv';
    }

    public function protectStr($str) {
    	return str_replace('"', '', $str);
    }

    protected function formatFloat($value) {

        return str_replace(".", ",", $value);
    }

    public function exportAll() {
        $csv = "";
        if ($this->header) {
            $csv .= $this->getHeaderCsv();
        }
        foreach(EtablissementAllView::getInstance()->getAll() as $json_doc) {
            $etablissement = EtablissementClient::getInstance()->find($json_doc->id);
            foreach($etablissement->liaisons_operateurs as $k => $liaison) {
                $csv .= $etablissement->identifiant.";";
                $csv .= $etablissement->nom.";";
                $csv .= $etablissement->cvi.";";
                $csv .= $etablissement->ppm.";";
                $csv .= $liaison->type_liaison.";";
                $csv .= preg_replace('/ETABLISSEMENT-/', '', $liaison->id_etablissement).";";
                $csv .= $liaison->libelle_etablissement.";";
                $csv .= $liaison->cvi.";";
                $csv .= $liaison->ppm.";";
                $csv .= $liaison->hash_chai.";";
                $csv .= ";"; // attributs chais
                $csv .= ";"; // aliaises
                $csv .= $liaison->id_etablissement.";";
                $csv .= $etablissement->_id.";";
                $csv .= $etablissement->_id.'/'.$k;
                $csv .= "\n";
            }
        }
        return $csv;
    }

}
{'fraction_non_alphanumeric': 0.16227558871531825, 'fraction_numerical': 0.0, 'mean_word_length': 2.051209103840683, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 53, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5454813', 'n_tokens_mistral': 1311, 'n_tokens_neox': 1291, 'n_words': 242}