<!--
SOFTWARE LIBRE
-->
<div class="crqt" id="Pral">
<form class="crqt" id="Escrito" "Estadisticas()">
<textarea onkeyup="Estadisticas()" id="Texto" class="crqt">Componente en pruebas. Escribe cualquier texto.</textarea>
</form>
<form class="crqt" id="Etiquetas">
<label>Palabras :<input id="Palabras" readonly="" /></label>
<label>Matrices :<input id="Matrices" readonly="" /></label>
<label>Caracteres :<input id="Caracteres" readonly="" /></label>
<label>Letras :<input id="Letras" readonly="" /></label>
<label>Párrafos :<input id="Parrafos" readonly="" /></label>
<label>Sílabas :<input id="Silabas" readonly="" /></label>
<label>Frases :<input id="Frases" readonly="" /></label>
<label style="border-top: solid thin">Szigriszt1993:<input id="Szigriszt1993" readonly="" style="border-top: solid thin"/></label>
<label>Perspicuidad :<input id="Perspicuidad" readonly="" /></label>
</form>
<script>
function Estadisticas() {
var strTexto = Texto.value;
var Resultado = 0
var pttPalabras = /([A-Za-z0-9\u00C0-\u02B8\-])[A-Za-z0-9\u00C0-\u02B8\-]*/g;
var pttMatrices = /./g;
var pttCaracteres= /\S/g;
var pttLetras = /[A-Za-z0-9\u00C0-\u02B8]/g;
var pttParrafos = /[\n][^\n]/g;
var pttSilabas = /[aeo]h[iu]|[iu]h[aeo]|[aeo][iu]|[aeo][y]|[y]|[íú]|[iu][^aeo]|[aeo]|[áéíóú]|[q|g]ui[aeo]/gi
var pttFrases = /[.?!][^.?!]/g;
var INFLESZ = "";
try {
Resultado = strTexto.match(pttPalabras).length;
var P = Resultado;
}
catch(err) {
Resultado = 0;
}
document.getElementById("Palabras").value = Resultado.toLocaleString();
try {
Resultado = strTexto.match(pttMatrices).length;
}
catch(err) {
Resultado = 0;
}
document.getElementById("Matrices").value = Resultado.toLocaleString();
try {
Resultado = strTexto.match(pttCaracteres).length;
}
catch(err) {
Resultado = 0;
}
document.getElementById("Caracteres").value= Resultado.toLocaleString();
try {
Resultado = strTexto.match(pttLetras).length;
var L = Resultado;
}
catch(err) {
Resultado = 0;
}
document.getElementById("Letras").value = Resultado.toLocaleString();
try {
Resultado = 1 + strTexto.match(pttParrafos).length;
}
catch(err) {
Resultado = 0;
}
document.getElementById("Parrafos").value = Resultado.toLocaleString();
try {
Resultado = strTexto.match(pttSilabas).length;
var S = Resultado;
}
catch(err) {
Resultado = 0;
}
document.getElementById("Silabas").value = Resultado.toLocaleString();
try {
Resultado = strTexto.match(pttFrases).length;
var F = Resultado;
}
catch(err) {
Resultado = 0;
}
document.getElementById("Frases").value = Resultado.toLocaleString();
Resultado = 206.835-62.3*S/P-P/F;
Resultado = Math.round(Resultado);
if (isNaN(Resultado)) {
Resultado = 0;
}
document.getElementById("Szigriszt1993").value = Resultado.toLocaleString();
if (Resultado<40) {
INFLESZ="Muy difícil";
}else if (Resultado<55) {
INFLESZ="Algo difícil";
}else if (Resultado<65) {
INFLESZ="Normal";
}else if (Resultado<80) {
INFLESZ="Bastante fácil";
}else {
INFLESZ="Muy fácil";
}
document.getElementById("Perspicuidad").value = INFLESZ;
}
</script>
<style type="text/css">
.crqt {
background-color: black;
color: rgb(0, 255, 0);
font-family: monospace;
font-size: 14px;
border-style: solid;
border-width: thin;
border-color: rgb(0, 255, 00);
}
form label {
display: inline;
width: 100px;
}
form input {
display: inline-block;
background-color: black;
color: rgb(0, 255, 0);
font-family: monospace;
font-size: 14px;
border-style: none;
width: 100px;
text-align: right;
}
textarea {
width: 98%;
height: 98%;
}
#Pral {
width: 670px;
height: 190px;
margin-right: auto;
margin-left: auto;
}
#Escrito {
width: 65%;
height: 99%;
float: left;
}
#Etiquetas {
width: 33%;
float: right;
}
</style>
</div>