<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML> <HEAD> <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252"> <TITLE></TITLE> <META NAME="GENERATOR" CONTENT="OpenOffice.org 3.0 (Win32)"> <META NAME="AUTHOR" CONTENT="piet willems"> <META NAME="CREATED" CONTENT="20081112;20170300"> <META NAME="CHANGED" CONTENT="0;0"> <style>
.schrijfstijl{border: 1px solid #4D636F; font-family:Tahoma; font-size:10pt} .mini{font-family:Tahoma; font-size:7pt;text-spacing:-1px;line-height:90%} </style>
<script language=javascript>
function splitsource(){ var temp,temptemp; var defstring; var tempsplit = new Array(); // final array var split = new Array(); temp = document.sourceform.source.value; temp = temp.toLowerCase(); temp=temp.split("n");
for(var i=0;i<temp.length;i++){ temp[i] = removechars(temp[i]); temptemp = temp[i].split(" "); // second split on every space in the frase. tempsplit = tempsplit.concat(temptemp); // add the second split to the final array. } tempsplit.sort(); tempsplit = RemoveDuplicates(tempsplit); //make tempsplit array displayable:
for(i=0;i<tempsplit.length;i++){ split = split+tempsplit[i]+"<br>"; } document.getElementById('result').className = 'schrijfstijl'; document.getElementById('result').innerHTML = split; // } function removechars(string){ var chars = new Array(',','r','n',''','<','>','-','(',')','{','}','"','.','?','¿','¡','!',':',';',','); // add (or change) here char's to the array if other char's need to be // removed. for(var c=0;c<chars.length;c++){ string = string.replace(chars[c]," "); } return string; } function RemoveDuplicates(arr){
var result=new Array(); // remove the doubles var lastValue="";
for (var i=0; i<arr.length; i++) { var curValue=arr[i]; if (curValue != lastValue) { result[result.length] = curValue; } lastValue=curValue; } return result; // return this result to the array : tempsplit. } </script> </HEAD>
<BODY TEXT="#000000"> <TABLE > <TR> <TD WIDTH=522 HEIGHT=18 ALIGN=LEFT bgcolor="#990000"><u><b> <font face="Arial" size="2" color="#FFFFFF">Javascript </font></b></u></TD> </TR> <TR> <TD WIDTH=522 HEIGHT=334 ALIGN=LEFT> <dl> <dt><font face="Arial" size="2">Deze code leest het ingaveveld = brontekst , sorteert de brontekst en verwijderd de dubplicaatwoorden.</font></dt> <dt><font face="Arial" size="2">vb: </font></dt> <dt><font face="Arial" size="2">Copier de volgende tekst en plak hem onderin het iingaveveld.</font></dt> <dt><font face="Arial" size="2">Druk nadien de "Verwerk" -knop.</font></dt> </dl> <table border="0" cellpadding="5" cellspacing="0" width="400"> <tr> <td align="left" valign="top" bgcolor="#CED8C5" style="border: 1px solid #4F6949"> <textarea rows="8" name="S1" cols="61" id="source" style="border: 1px solid #687D55">Je kan niet voorstellen hoe de mensen de laatste tijd worden belogen hoe ze worden bedrogen hoe ze worden veracht en vernederd, alleen nog in wat ze opbrengen is er nog belangstelling.</textarea> </td> </tr> </table> </TD> </TR> <TR> <TD HEIGHT=18 ALIGN=LEFT bgcolor="#990000"><b> <font face="Arial" size="2" color="#FFFFFF">Ingaveveld</font></b></TD> </TR> <TR> <TD HEIGHT=154 ALIGN=LEFT> <form method="POST" name="sourceform" action=""> <p><textarea rows="4" name="S1" cols="62" id="source"></textarea></p> <input type="button" value="Verwerk" name="B1" onclick="splitsource()"> <input type="reset" value="reset" name="B2"> </form> <p> </TD> </TR> <TR> <TD HEIGHT=18 ALIGN=LEFT bgcolor="#990000"><b> <font face="Arial" size="2" color="#FFFFFF">Resultaat</font></b></TD> </TR> <TR> <TD HEIGHT=40 ALIGN=LEFT id="result"> </TD> </TR> <TR> <TD HEIGHT=21 ALIGN=LEFT> </TD> </TR> </TABLE>
</BODY>
</HTML>
|