Ilguritmen

Extraction de mots d’un texte:

function sekyedasekkil(x,y)
{
j=0
while (j<y.length)
 {
if (x==y[j])
 return true
j++
 }
return false
}

function tidaddnin()
{
 var isekkilen = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","č","ḍ","ǧ","ḥ","ɣ","ṛ","ṣ","ṭ","ɛ","ẓ","ţ"];
 var izamulen=[]
 var awalen =[]
 var i = 0;
 var j=0;
 var aḍris = document.getElementById('texte').value.toLowerCase();

while (i < aḍris.length)
 {
if (!(sekyedasekkil(aḍris[i],isekkilen)) && (!(sekyedasekkil(aḍris[i],izamulen))))
 {
 izamulen.push(aḍris[i]);
 aḍris[i]=" ";

}
 i++;
 }
i=0
while (i<izamulen.length)
{
aḍris = aḍris.replace(izamulen[i], " ");
i++
}
return aḍris.split(" ")
}

 

Initiation à la conjugaison:

function sekyed(x,y)
{j=0
while (j<y.length)
 {
if (x==y[j])
 return true

j++
 }
return false
}
function sefti()
{
var talɣa["","","","","","","","","","",""]
var tiɣra=["a","i","u","e"]
var uzwiren = ["","t","y","t","n","t","t","",""];
var uzwiren_tiɣra = ["","te","i","te","ne","te","te","",""];
var uḍfiṛen = ["eɣ","eḍ","","","","em","emt","en","ent"];
var amyag = document.getElementById('aḍris').value.toLowerCase();
inerhtml='<table><tr><td> amyag: '+amyag+'</td><tr>';
inerhtml=inerhtml+'<table><tr><td> aoriste (futur) </td></tr>';
i=0
while (i<uzwiren.length)
{
if (sekyed(amyag[0],tiɣra))
 {
inerhtml=inerhtml+'<tr><td>ad '+uzwiren[i]+amyag+uḍfiṛen[i]+'</td></tr>'

}
else
 {
inerhtml=inerhtml+'<tr><td>ad '+uzwiren_tiɣra[i]+amyag+uḍfiṛen[i]+'</td></tr>'
}
i++
}
inerhtml=inerhtml+'</table>'
document.getElementById('taseftit').innerHTML=inerhtml
}

Occurence

function testchar(x,y)
{
 j=0
 while (j<y.length)
 {a
 if (x==y[j])
 return true

j++
 }

return false

}

function tidaddnin()

{

var isekkilen = ["-",",","!","?",";",".","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","č","ḍ","ǧ","ḥ","ɣ","ṛ","ṣ","ṭ","ɛ","ẓ","ţ"];

var imdhanen = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];

var i = 0;
 var total=0;
 var adhris = document.getElementById('texte').value.toLowerCase();

while (i < adhris.length)
 {

if (testchar(adhris[i],isekkilen))
 {
 imdhanen[isekkilen.indexOf(adhris[i])]++;
 total++
 }
 i++;
 }
 k=0
 l=0
 while (k<imdhanen.length)
 {
 if (imdhanen[k]==0)
 l++
 k++
 }
 document.getElementById('mydiv').innerHTML=total
 document.getElementById('number').innerHTML=l
i=0
inerhtml='<table widt="100%"><tr><td>asekkil : </td><td>amḍan n tikwal : </td><td>Afmiḍi : </td></tr><tr>';
while (i<isekkilen.length)
{
inerhtml=inerhtml+'<td>'+isekkilen[i]+'</td>'+'<td>'+imdhanen[i]+'</td>'+'<td>'+imdhanen[i]*100/total+'</td></tr>'
i++
}
inerhtml=inerhtml+'</table>'

document.getElementById('tikwal').innerHTML=inerhtml

}

 

Occurence voisin double

function bnu_isirew2()
{
var isekkilen = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","č","ḍ","ǧ","ḥ","ɣ","ṛ","ṣ","ṭ","ɛ","ẓ","ţ","-"];
var izriren2=[];
var timeḍriwt=[];
k=0;
i=0;
while (i<isekkilen.length)
 {
j=0
 while (j<isekkilen.length)
 {
 z=isekkilen[i]+isekkilen[j]
 j++
 izriren2.push(z);
 }
i++
 }
return izriren2
}
function timedriwt2()
{
 var isekkilen = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","č","ḍ","ǧ","ḥ","ɣ","ṛ","ṣ","ṭ","ɛ","ẓ","ţ","-"];
 var isirew= bnu_isirew2()

var ljiran_yellan = [];
 var timedriwt=[];
 var i = 1;
 var total=0;
 var adhris = document.getElementById('texte').value.toLowerCase();

while (i < adhris.length)
 {
 if (testchar(adhris[i],isekkilen) && testchar(adhris[i-1],isekkilen))
 {
 ch=adhris[i-1]+adhris[i]

if (testchar(ch,isirew))
 {
 if (testchar(ch,ljiran_yellan))
 {
 indice=ljiran_yellan.indexOf(ch)
 timedriwt[indice]=timedriwt[indice]+1
 }
 else
 {
 ljiran_yellan.push(ch)
 timedriwt.push(1)
 }
 }
 }
 i++
 }
i=0
total=0
while (i<timedriwt.length)
{
 total=total+timedriwt[i]
 i++
}
i=0
inerhtml='<table><tr><td>voisinage double:</td><td>occurence:</td><td>Poucentage:</td></tr><tr>';
while (i<timedriwt.length)
{
inerhtml=inerhtml+'<td>'+ljiran_yellan[i]+'</td>'+'<td>'+timedriwt[i]+'</td>'+'<td>'+(timedriwt[i]*100)/total+'</td></tr>'
i++
}
inerhtml=inerhtml+'</table>'
document.getElementById('voisinage2').innerHTML=inerhtml
}
//fin des voisin de deux

 

Voisin triple

function bnu_isirew3()
{
var isekkilen = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","č","ḍ","ǧ","ḥ","ɣ","ṛ","ṣ","ṭ","ɛ","ẓ","ţ","-"];
var izriren2=[];
var timeḍriwt=[];
k=0;
i=0;
while (i<isekkilen.length)
 {
j=0
 while (j<isekkilen.length)
 {k=0
 while (k<isekkilen.length)
 {
 z=isekkilen[i]+isekkilen[j]+isekkilen[k]
 izriren2.push(z);
 k++
 }
 j++

}
i++
 }
return izriren2
}
function timedriwt3()
{
 var isekkilen = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","č","ḍ","ǧ","ḥ","ɣ","ṛ","ṣ","ṭ","ɛ","ẓ","ţ","-"];
 var isirew= bnu_isirew3()

var ljiran_yellan = [];
 var timedriwt=[];
 var i = 2;
 var total=0;
 var adhris = document.getElementById('texte').value.toLowerCase();

while (i < adhris.length)
 {
 if (testchar(adhris[i],isekkilen) && testchar(adhris[i-1],isekkilen) && testchar(adhris[i-2],isekkilen))
 {
 ch=adhris[i-2]+adhris[i-1]+adhris[i]

if (testchar(ch,isirew))
 {
 if (testchar(ch,ljiran_yellan))
 {
 indice=ljiran_yellan.indexOf(ch)
 timedriwt[indice]=timedriwt[indice]+1
 }
 else
 {
 ljiran_yellan.push(ch)
 timedriwt.push(1)

}
 }
 }
 i++
 }
i=0
total=0
while (i<timedriwt.length)
{
 total=total+timedriwt[i]
 i++
}
i=0
inerhtml='<table><tr><td>voisinage triple:</td><td>occurence:</td><td>Poucentage:</td></tr><tr>';
while (i<timedriwt.length)
{
inerhtml=inerhtml+'<td>'+ljiran_yellan[i]+'</td>'+'<td>'+timedriwt[i]+'</td>'+'<td>'+(timedriwt[i]*100)/total+'</td></tr>'
i++
}
inerhtml=inerhtml+'</table>'
document.getElementById('voisinage3').innerHTML=inerhtml
}