bookmarklet ft
frantext frequences to regle
by toubia95
HTML
<a href="">Règle à partir des résultats de fréquences</a>
<div _ngcontent-c43="" class="table table-striped table-hover">
<div _ngcontent-c43="" class="table-header">
<div _ngcontent-c43="" class="table-cell"></div>
<!---->
<!---->
<!---->
<div _ngcontent-c43="" class="table-cell level ng-star-inserted" style="touch-action: none; user-select: none; -webkit-user-drag: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);" aria-describedby="cdk-describedby-message-30" cdk-describedby-host="">Niveau 1</div>
<!---->
<div _ngcontent-c43="" class="table-cell frequency numeric">Fréquence</div>
<div _ngcontent-c43="" class="table-cell progress-bar"></div>
</div>
<!---->
<div _ngcontent-c43="" class="table-row ng-star-inserted">
<div _ngcontent-c43="" class="table-cell index">1</div>
<!---->
<!---->
<!---->
<!---->
<div _ngcontent-c43="" class="table-cell ng-star-inserted">arbres</div>
<!---->
<div _ngcontent-c43="" class="table-cell frequency numeric">28311</div>
<div _ngcontent-c43="" class="table-cell progress-bar">
<mat-progress-bar _ngcontent-c43="" aria-valuemax="100" aria-valuemin="0" class="mat-progress-bar mat-primary" role="progressbar" aria-valuenow="100" mode="determinate"><svg class="mat-progress-bar-background mat-progress-bar-element" focusable="false" height="4" width="100%"><defs><pattern height="4" patternUnits="userSpaceOnUse" width="8" x="4" y="0" id="mat-progress-bar-0"><circle cx="2" cy="2" r="2"></circle></pattern></defs><rect height="100%" width="100%" fill="url('/repository/frantext/search/concordance?mode=assisted&h=0bbb87e8e98916cd2b043acd57d245cf&s=eyJ2aWV3Ijoia3dpYyIsInpvb20iOnsiZGF0YXNldHMiOlsid29yZCJdLCJ0eXBlIjoiZGlhbG9nIiwic2l6ZSI6NzAwLCJmb250U2l6ZSI6MTV9LCJjb250ZXh0Ijp7ImRhdGFzZXRzIjpbIndvcmQiXSwic2l6ZSI6NTAwLCJkZW5zZSI6ZmFsc2V9LCJrd2ljIjp7ImRhdGFzZXRzIjpbIndvcmQiXSwic2l6ZSI6MTAwfX0%3D#mat-progress-bar-0')"></rect></svg>
<div
...
CSS
/*
détecter le bouton orange des fréquences et ajouter une icone liste pour récupérer la liste...
travailler dans
https://www.frantext.fr/repository/frantext*(-demo/-agregation)/search/concordance
*/
JavaScript
javascript:(function(){var a = document.querySelectorAll('.table-row .table-cell.ng-star-inserted'); if (a.length) {var b = "";Array.prototype.forEach.call(a,function(el,i){var c = el.textContent; if(i == 0){b = "règle " + c + " = \"" + c;} else{b += "|" + c;}});window.prompt("RÈGLE GÉNÉRÉE À PARTIR DES FRÉQUENCES :\n==================================\n1. Copiez la règle (Ctrl-C)\n2. Fermez cette fenêtre (bouton OK ou touche ENTER)\n3. Créez une grammaire et collez la règle (Ctrl-V)\nMISE EN GARDE : Frantext fonctionne mal avec des règles trop longues ou dont l'intitulé contient des caractères spéciaux.", b + "\"%25cd");} else {alert("Impossible de créer la règle !");}})();