void camrec(int cascade ){/* // int cascade = 0; Rectangle[] faces; if (cam.available() == true) { cam.read();} //img2 = cam ; // img2 = loadImage(refDisk + refSubdirectory + "\\" + refDoc + ".JPG" ); preMix(); opencv = new OpenCV(this, img3 ); String formName = ""; switch (cascade){ case 0 : opencv.loadCascade(OpenCV.CASCADE_FRONTALFACE); formName = "faces" ; break ; case 1 : opencv.loadCascade( OpenCV.CASCADE_PEDESTRIANS); formName = "pedestrians" ; break ; case 2 : opencv.loadCascade( OpenCV.CASCADE_EYE); formName = "eyes" ; break ; case 3 : opencv.loadCascade( OpenCV.CASCADE_CLOCK); formName = "clocks" ; break ; case 4 : opencv.loadCascade( OpenCV.CASCADE_NOSE); formName = "noses" ; break ; case 5 : opencv.loadCascade( OpenCV.CASCADE_MOUTH); formName = "mouths" ; break ; case 6 : opencv.loadCascade( OpenCV.CASCADE_UPPERBODY); formName = "upperbodies" ; break ; case 7 : opencv.loadCascade( OpenCV.CASCADE_LOWERBODY); formName = "lowerbodies" ; break ; case 8 : opencv.loadCascade( OpenCV.CASCADE_FULLBODY); formName = "full bodies" ; break ; case 9 : opencv.loadCascade( OpenCV.CASCADE_PEDESTRIANS); formName = "pedestrians" ; break ; case 10 : opencv.loadCascade( OpenCV.CASCADE_RIGHT_EAR); formName = "right ears" ; break ; case 11 : opencv.loadCascade( OpenCV.CASCADE_PROFILEFACE); formName = "profile faces " ; break ; } faces = opencv.detect(); Scroll(String.valueOf(faces.length) + " " + formName ); //no rec"); img2 = opencv.getInput() ; //.getOutput() ; preMix(); Mix(1, 0) ; for (int i = 0; i < faces.length; i++) { println("facesix " + String.valueOf(faces[i].x)); rect(faces[i].x, faces[i].y, faces[i].width, faces[i].height); Ddo("black"); Ddo("thin"); xorig = faces[i].x ; yorig = faces[i].y ; xtarg = xorig + faces[i].width ; ytarg = yorig + faces[i].height ; Form(30); Ddo(":"); } */} ////// File ////// void camBW(){/* println("in camBW"); color white = color(255); color black = color(0); *//* video = new Capture(this, hhh, vvv, cameras[97]); //800, 600, cameras[97]); //video = new Capture(this, 640, 480); video.start(); *//*numPixels = hhh*vvv; //video.width * video.height; if (cam.available()) { cam.read(); cam.loadPixels(); int threshold = 127; // Set the threshold value float pixelBrightness; // Declare variable to store a pixel's color // Turn each pixel in the video frame black or white depending on its brightness loadPixels(); for (int i = 0; i < numPixels; i++) { pixelBrightness = brightness(video.pixels[i]); if (pixelBrightness > threshold) { // If the pixel is brighter than the pixels[i] = white; // threshold value, make it white } else { // Otherwise, pixels[i] = black; // make it black } } updatePixels(); } // PImage src = loadImage("data/RoxWorks/Manh.JPG"); opencv = new OpenCV(this, src); opencv.invert(); Rectangle[] faces; opencv.loadCascade(OpenCV.CASCADE_FRONTALFACE); faces = opencv.detect(); img2 = opencv.getOutput() ; preMix(); Mix(1, 0) ; PVector loc = opencv.max(); println(String.valueOf(loc.x) + " " + String.valueOf(loc.y)); stroke(255, 0, 0); strokeWeight(4); noFill(); ellipse(loc.x/2, loc.y/2, 10, 10); */} void cam2(){/* color white = color(255); color black = color(0); if (video.available()) { video.read(); video.loadPixels(); int threshold = 127; // Set the threshold value float pixelBrightness; // Declare variable to store a pixel's color // Turn each pixel in the video frame black or white depending on its brightness loadPixels(); for (int i = 0; i < numPixels; i++) { pixelBrightness = brightness(video.pixels[i]); if (pixelBrightness > threshold) { // If the pixel is brighter than the pixels[i] = white; // threshold value, make it white } else { // Otherwise, pixels[i] = black; // make it black } } updatePixels(); } image(opencv.getOutput(), 0, 0); PVector loc = opencv.max(); stroke(255, 0, 0); strokeWeight(4); noFill(); ellipse(loc.x, loc.y, 10, 10); */} void TextY(String lettre ){ String locFont = "Larousse" ; //"Yann"; String let = "" ; //refTextX = 50 ; refTextY = 50 ; int locFontSize = 100 ; int lineLength = 0 ; for(int i=0; i 0){ int wordsv = 0 ; while ( (wordsv < refTextLength)&&(imageFound == false)) { wordsv++ ; extensionSearch2(textLine[wordsv]); if (((text_Ext.equals ("jpg"))||(text_Ext.equals ("JPG"))||(text_Ext.equals ("png")) )){ try{ img2 = loadImage(docAch); imageFound = true ; preMix(); Mix(1); } catch(Exception im){println("err image " + textItem[scriptLineNumber][1]); } }}} if (imageFound = false) Service(100); //loadimage img.save(refDisk + "Image.jpg"); } /* void jpgLoad(String docach){ //===================================================Load println("in jpgload, docach " + docach); int docWidth =1 ; int docHeight = 1 ; int docProp = 1 ; //the region has been assigned eslwhere int xdd = xd ; int ydd = yd ; int xff = xf ; int yff = yf ; int regWidth = xf - xd ; int regHeight = yf - yd ; int regProp = (100*regWidth)/regHeight; int displayGapx = 0; int displayGapy = 0; fileLoading = true; // 1. Loading the external image in img2 if ( (( xf -xd) >0)&&((yf-yd) >0)){ //this block ends near the end of the function try{ img2 = loadImage(docach); } catch(Exception e) { img2 = loadImage(refDisk + "Roxame/!!!temp0.BMP"); Scroll("in img2_load, not OK"); } //Scroll("refInsert " + String.valueOf(refInsert)); //===================================================================== switch(refInsert){ //img2 is clipped into the region, according to different methods case 107 : //stretch. proportions are changed, the full rectangle is inserted for (int x = xd ; x< xf +1 ; x++){ for (int y = yd ; y< yf +1 ; y++){ img.set( x, y, img2.get( ((x-xd)*docWidth)/regWidth , ((y-yd)*docHeight)/regHeight )) ; }} break ; case 105 : //fillreg the document is projected at the size of the whole image, but only in the region rectangle (useful ?) for (int x = 0 ; x< wwidth ; x++) { for (int y = 0; y< wheight ; y++){ if ( (x>xd)&&(xyd)&&(y xd)&&(yf>yd)){ if (docProp >= regProp) { //the document is wider //compute the width to be kept, disbritue by half int widthKept = (docHeight*(xf-xd))/(yf-yd) ; int docGapx = (docWidth - widthKept)/2 ; for (int x = xd; xxd)&&(yf>yd)){ if (docProp >= regProp) {//the document is wider regHeight = min( (yf-yd), ((xf-xd)* docHeight)/ docWidth ); // the document is wider displayGapy = (yf - yd - regHeight)/2 ; for (int x = xd ; x< xf +1 ; x++) { for (int y = 0; yxd)&&(yf>yd)){ if (docProp >= regProp) {//the document is wider //Scroll("Wider"); regHeight = min( (yf-yd), ((xf-xd)* docHeight)/ docWidth ); // the document is wider displayGapy = (yf - yd - regHeight)/2 ; for (int x = xd ; x< xf +1 ; x++) { for (int y = 0; yxd)&&(yf>yd)){ for (int x = xd; x ") ; Log("
















") ; Log(String.valueOf(docHeight) + "." + String.valueOf(docWidth) + " pixels"); } loadedDoc = true ; fileLoading = false ; if (refDialMode == 0){} }//end of not null region } */ void extensionSearch2(String lineExt){//extensionSearch in a line int ppos = 1; text_Ext = ""; rightWd = 0; Rread(lineExt); for(int wd = 2; wd 9){ //look for the point to detect extension ppos = 1; while((ppos"); //fermeture out.write(textItem[i][2]); //nom out.write(" "); //espace out.write(textItem[i][3]); //prénom . Item2 out.write(" "); //fin du nom du lien et espace Continent = "PP"; if (textItem[i][4].equals("France")) Continent = "F" ; if (textItem[i][4].equals("Algeria")) Continent = "AF" ; if (textItem[i][4].equals("Argentina")) Continent = "LA" ; if (textItem[i][4].equals("Australia")) Continent = "A" ; if (textItem[i][4].equals("Austria")) Continent = "E" ; if (textItem[i][4].equals("Belgium")) Continent = "E" ; if (textItem[i][4].equals("BieloRussia")) Continent = "E" ; if (textItem[i][4].equals("Brazil")) Continent = "LA" ; if (textItem[i][4].equals("Bulgaria")) Continent = "E" ; if (textItem[i][4].equals("Cameroon")) Continent = "AF" ; if (textItem[i][4].equals("Canada")) Continent = "NA" ; if (textItem[i][4].equals("Chile")) Continent = "LA" ; if (textItem[i][4].equals("China")) Continent = "A" ; if (textItem[i][4].equals("Columbia")) Continent = "LA" ; if (textItem[i][4].equals("Congo")) Continent = "AF" ; if (textItem[i][4].equals("Croatia")) Continent = "E" ; if (textItem[i][4].equals("Czech-Republic")) Continent = "E" ; if (textItem[i][4].equals("Danemark")) Continent = "E" ; if (textItem[i][4].equals("Dominica")) Continent = "LA" ; if (textItem[i][4].equals("Egypt")) Continent = "AF" ; if (textItem[i][4].equals("Estonia")) Continent = "E" ; if (textItem[i][4].equals("Finland")) Continent = "E" ; if (textItem[i][4].equals("Germany")) Continent = "E" ; if (textItem[i][4].equals("Greece")) Continent = "E" ; if (textItem[i][4].equals("Hungary")) Continent = "E" ; if (textItem[i][4].equals("Iceland")) Continent = "E" ; if (textItem[i][4].equals("India")) Continent = "A" ; if (textItem[i][4].equals("Indonesia")) Continent = "A" ; if (textItem[i][4].equals("Ireland")) Continent = "E" ; if (textItem[i][4].equals("Israel")) Continent = "ME" ; if (textItem[i][4].equals("Italy")) Continent = "E" ; if (textItem[i][4].equals("Japan")) Continent = "A" ; if (textItem[i][4].equals("Kenya")) Continent = "AF" ; if (textItem[i][4].equals("Korea")) Continent = "A" ; if (textItem[i][4].equals("Kosovo")) Continent = "E" ; if (textItem[i][4].equals("Latvia")) Continent = "E" ; if (textItem[i][4].equals("Lebanon")) Continent = "ME" ; if (textItem[i][4].equals("Mali")) Continent = "AF" ; if (textItem[i][4].equals("Mexico")) Continent = "LA" ; if (textItem[i][4].equals("Morocco")) Continent = "AF" ; if (textItem[i][4].equals("Netherlands")) Continent = "E" ; if (textItem[i][4].equals("New_Zealand")) Continent = "A" ; if (textItem[i][4].equals("Nigeria")) Continent = "AF" ; if (textItem[i][4].equals("Norway")) Continent = "E" ; if (textItem[i][4].equals("Peru")) Continent = "LA" ; if (textItem[i][4].equals("Poland")) Continent = "E" ; if (textItem[i][4].equals("Portugal")) Continent = "E" ; if (textItem[i][4].equals("RDC")) Continent = "AF" ; if (textItem[i][4].equals("Romania")) Continent = "E" ; if (textItem[i][4].equals("Russia")) Continent = "E" ; if (textItem[i][4].equals("Senegal")) Continent = "AF" ; if (textItem[i][4].equals("Singapore")) Continent = "A" ; if (textItem[i][4].equals("Slovenia")) Continent = "E" ; if (textItem[i][4].equals("South-Africa")) Continent = "AF" ; if (textItem[i][4].equals("Spain")) Continent = "E" ; if (textItem[i][4].equals("Sweden")) Continent = "E" ; if (textItem[i][4].equals("Switzerland")) Continent = "E" ; if (textItem[i][4].equals("Taiwan")) Continent = "A" ; if (textItem[i][4].equals("Tunisia")) Continent = "AF" ; if (textItem[i][4].equals("Turkey")) Continent = "ME" ; if (textItem[i][4].equals("USA")) Continent = "NA" ; if (textItem[i][4].equals("United-Kingdom")) Continent = "E" ; if (textItem[i][4].equals("Venezuela")) Continent = "LA" ; out.write(textItem[i][4] + " " + Continent + " " ); //country + continent GSpec = "NS"; if (textItem[i][5].equals("Animation")) GSpec = "C" ; if (textItem[i][5].equals("Architecture")) GSpec = "O" ; if (textItem[i][5].equals("Bio-Art")) GSpec = "W" ; if (textItem[i][5].equals("Calligraphy")) GSpec = "I" ; if (textItem[i][5].equals("Cinema")) GSpec = "C" ; if (textItem[i][5].equals("Cooking")) GSpec = "O" ; if (textItem[i][5].equals("Dance")) GSpec = "P" ; if (textItem[i][5].equals("Fabrics")) GSpec = "O" ; if (textItem[i][5].equals("Games")) GSpec = "W" ; if (textItem[i][5].equals("Interaction")) GSpec = "W" ; if (textItem[i][5].equals("Light")) GSpec = "C" ; if (textItem[i][5].equals("Moves")) GSpec = "O" ; if (textItem[i][5].equals("Multimedia")) GSpec = "W" ; if (textItem[i][5].equals("Music")) GSpec = "M" ; if (textItem[i][5].equals("Objects")) GSpec = "O" ; if (textItem[i][5].equals("Painting")) GSpec = "I" ; if (textItem[i][5].equals("Performance")) GSpec = "P" ; if (textItem[i][5].equals("Photography")) GSpec = "I" ; if (textItem[i][5].equals("Robotics")) GSpec = "O" ; if (textItem[i][5].equals("Sculpture")) GSpec = "O" ; if (textItem[i][5].equals("Theater")) GSpec = "P" ; if (textItem[i][5].equals("Tools")) GSpec = "W" ; if (textItem[i][5].equals("VJ")) GSpec = "P" ; if (textItem[i][5].equals("Video")) GSpec = "C" ; if (textItem[i][5].equals("Web")) GSpec = "W" ; if (textItem[i][5].equals("Writing")) GSpec = "T" ; //specialty + group of specialties out.write(textItem[i][5] + " " + GSpec + " "); for (int j = 6; j < 11 ; j++) out.write(textItem[i][j] + " ") ; //Items 7 à 10 out.write("
" + "\r\n") ; } out.close(); }//end of try catch (IOException e) {} } void tsfilecut2(){ Scroll("in tscut"); Scroll("CT " + String.valueOf(refTextLength)); String textFile = refDisk + "Roxame\\Artistes_cut.txt"; try { BufferedWriter out = new BufferedWriter(new FileWriter(textFile)); Scroll("INCUT" + String.valueOf(refTextLength)); //for (int i = 1 ; i< 100; i++){ for (int i = 1 ; i" + "\r\n") ; } for (int lsup = 0; lsup<5; lsup++) {out.write("1...." + "\r\n");} out.close(); }//end of try catch (IOException e) {} } void textSort(int column, char sort_order, int columnSup){ //columnSup indique s'il faut ou non supprimer la colonne de tri à l'édition //println("in textSort " + refText + " " + sort_order); column = min(column, 18); boolean wordtag = true ; String[] wordbuf = new String[wordsNumber] ; for (int i = 0; i< wordsNumber; i++) wordbuf[i] = " "; int te ; int columnSubtotal = 0; int indexTotal = 0; int crit1 = 0; int crit2 = 0 ; while (wordtag == true){ wordtag = false; te = 1; switch (sort_order){ case 'd' : //direct alphabeticallly //println("length " + String.valueOf(refTextLength)); while (te< refTextLength ) { if (te%10000 == 0) println(String.valueOf(te) + " " + textLine); if( textItem[te][column].compareTo(textItem[te+1][column] ) >0) { wordtag = true; for (int i=0; i crit2 ) { wordtag = true; for (int i=0; i crit2 ) { wordtag = true; for (int i=0; i

" + "\r\n"); } //main text================================= for( int wordsv = 1 ; wordsv1) {if (compareString.length() >15) compareInitial = compareString.substring(15,16);} //only initials on alpha list //lines count adding if (columnSup !=9) {//not ssort if (!(textItem[wordsv][column].equals(compareString))) { if (columnSubtotal >3) { switch (column){ case 1 : break; case 11 : out.write(String.valueOf(columnSubtotal) + " ouvrages."+ "
" + "\r\n"); case 12 : break; case 13 : break; default : out.write(String.valueOf(columnSubtotal) + " artists."+ "
" + "\r\n");columnSubtotal = 0; break; }} columnSubtotal = 0; //subtitle adding ==================== switch (column) { case 1 : //alpha if (!(textItem[wordsv][column].substring(15,16).equals(compareInitial))){ out.write("

\r\n"); out.write("

" + " " + textItem[wordsv][column].substring(15,16) + "

\r\n

"); } break; case 5 : // speciality out.write("

\r\n");// that's for use in the HTML file out.write("

" + textItem[wordsv][column] + "" + "
") ; //"\r\n"); out.write("

See notice about " + textItem[wordsv][column] + "

" + "\r\n"); break; case 7 : //dates if (textItem[wordsv][column].equals("0")) prepText = "Antiquity"; else prepText = "Years " + textItem[wordsv][column] + "'s" ; out.write("

\r\n"); out.write("

"+ prepText + "

\r\n

"); //out.write("

Années " + textItem[wordsv][column] + "

\r\n

"); break; case 8 : //notoriete if (textItem[wordsv][column].equals("*****")) prepText = "The stars" ; if (textItem[wordsv][column].equals("****")) prepText = "Famed" ; if (textItem[wordsv][column].equals("***")) prepText = "Widely known" ; if (textItem[wordsv][column].equals("**")) prepText = "Known in their domain" ; if (textItem[wordsv][column].equals("*")) prepText = "To be discovered" ; out.write("

\r\n"); out.write("

" + prepText + "

"); break; case 9 : //generative if (textItem[wordsv][column].equals("GGGG")) prepText = "Strongly generative" ; if (textItem[wordsv][column].equals("GGG")) prepText = "Generative" ; if (textItem[wordsv][column].equals("GG")) prepText = "Weakly generative" ; if (textItem[wordsv][column].equals("G")) prepText = "Not generative" ; out.write("

\r\n"); out.write("

" + prepText + "

"); break; case 10 : //gender if (textItem[wordsv][column].equals("X")) prepText = "Men" ; if (textItem[wordsv][column].equals("Y")) prepText = "Women" ; if (textItem[wordsv][column].equals("Z")) prepText = "Groups" ; out.write("

\r\n"); out.write("

" + prepText + "

"); break; case 11 : //books out.write("

\r\n"); out.write("

Années " + textItem[wordsv][column] + "0

" + "\r\n"); out.write("

" + "\r\n"); break; case 12 : //works by dates case 13 : //works by authors break; default : // par exemple, pays out.write("

\r\n");// that's for use in the HTML file out.write("

" + textItem[wordsv][column] + "

" + "\r\n"); break; }}} //============================== //main lines for (int j = 0; j<11 ; j++) { if (columnSup == 9) out.write(textItem[wordsv][j] + " "); //ssort else { if (column == 1) out.write(textItem[wordsv][j] + " "); //alpha else if ((j != column)||(columnSup == 9)) out.write(textItem[wordsv][j] + " "); //on supprime la col sauf si en ssort }} out.write("
" + "\r\n") ; } //end of line sweeping //ending data if (columnSup != 9){ if (columnSubtotal >3) { switch (column){ case 11 : out.write(String.valueOf(columnSubtotal) + " ouvrages."+ "
" + "\r\n"); break ; case 12 : out.write("\r\n");break; case 13 : out.write("\r\n"); break; default : out.write(String.valueOf(columnSubtotal) + " artists."+ "
" + "\r\n"); break; }} out.write("
" + "\r\n") ; if (column != 11) out.write("TOTAL : " + String.valueOf(indexTotal) + " artists." + "
" + "\r\n"); else out.write("TOTAL : " + String.valueOf(indexTotal) + " ouvrages." + "
" + "\r\n"); } out.close(); } //end of try catch (IOException e) {} } void textCopyArtist(){//to copy the Artist file from !!!SITE_WEB into Roxame/data/texts //1. Load the text //Scroll("in txtCopyArtist"); println("in txtCopyArtist"); String readline_ , line ; refTextLength = 0; try{ //lecture du fi hier sur le site BufferedReader indico = new BufferedReader(new FileReader(refDisk + "!!!SITE_WEB\\Artistes_base.txt")); nbchar = 0; dicoString = ""; // Scroll("txtcpy try_loop"); //println("in txtL " + txtAch); do{ line = indico.readLine(); if (line != null) {refTextLength++ ; String testString; textLine[refTextLength] = line + "
"; // println("textLine " + textLine[refTextLength]) ; if (textLine[refTextLength].substring(0,1).equals("A") ) textLine[refTextLength] = "a " + textLine[refTextLength]; if (textLine[refTextLength].substring(0,1).equals("B") ) textLine[refTextLength] = "b " + textLine[refTextLength]; if (textLine[refTextLength].substring(0,1).equals("C") ) textLine[refTextLength] = "c " + textLine[refTextLength]; if (textLine[refTextLength].substring(0,1).equals("D") ) textLine[refTextLength] = "d " + textLine[refTextLength]; if (textLine[refTextLength].substring(0,1).equals("E") ) textLine[refTextLength] = "e " + textLine[refTextLength]; if (textLine[refTextLength].substring(0,1).equals("F") ) textLine[refTextLength] = "f " + textLine[refTextLength]; if (textLine[refTextLength].substring(0,1).equals("G") ) textLine[refTextLength] = "g " + textLine[refTextLength]; if (textLine[refTextLength].substring(0,1).equals("H") ) textLine[refTextLength] = "h " + textLine[refTextLength]; if (textLine[refTextLength].substring(0,1).equals("I") ) textLine[refTextLength] = "i " + textLine[refTextLength]; if (textLine[refTextLength].substring(0,1).equals("J") ) textLine[refTextLength] = "j " + textLine[refTextLength]; if (textLine[refTextLength].substring(0,1).equals("K") ) textLine[refTextLength] = "k " + textLine[refTextLength]; if (textLine[refTextLength].substring(0,1).equals("L") ) textLine[refTextLength] = "l " + textLine[refTextLength]; if (textLine[refTextLength].substring(0,1).equals("M") ) textLine[refTextLength] = "m " + textLine[refTextLength]; if (textLine[refTextLength].substring(0,1).equals("N") ) textLine[refTextLength] = "n " + textLine[refTextLength]; if (textLine[refTextLength].substring(0,1).equals("O") ) textLine[refTextLength] = "o " + textLine[refTextLength]; if (textLine[refTextLength].substring(0,1).equals("P") ) textLine[refTextLength] = "p " + textLine[refTextLength]; if (textLine[refTextLength].substring(0,1).equals("Q") ) textLine[refTextLength] = "q " + textLine[refTextLength]; if (textLine[refTextLength].substring(0,1).equals("R") ) textLine[refTextLength] = "r " + textLine[refTextLength]; if (textLine[refTextLength].substring(0,1).equals("S") ) textLine[refTextLength] = "s " + textLine[refTextLength]; if (textLine[refTextLength].substring(0,1).equals("T") ) textLine[refTextLength] = "t " + textLine[refTextLength]; if (textLine[refTextLength].substring(0,1).equals("U") ) textLine[refTextLength] = "u " + textLine[refTextLength]; if (textLine[refTextLength].substring(0,1).equals("V") ) textLine[refTextLength] = "v " + textLine[refTextLength]; if (textLine[refTextLength].substring(0,1).equals("W") ) textLine[refTextLength] = "w " + textLine[refTextLength]; if (textLine[refTextLength].substring(0,1).equals("X") ) textLine[refTextLength] = "x " + textLine[refTextLength]; if (textLine[refTextLength].substring(0,1).equals("Y") ) textLine[refTextLength] = "y " + textLine[refTextLength]; if (textLine[refTextLength].substring(0,1).equals("Z") ) textLine[refTextLength] = "z " + textLine[refTextLength]; if (textLine[refTextLength].substring(0,1).equals("0") ) textLine[refTextLength] = "# " + textLine[refTextLength]; } } while (line !=null); indico.close(); println("in textcopy artists " + String.valueOf(refTextLength) + "lines"); } catch (Exception e){Scroll("error in txtLoad"); } Scroll("end txtcopyartist"); //2. Save the text String textFile = refDisk + "Roxame\\data\\Texts\\Artistes_cut.txt"; //texte à produire try { BufferedWriter out = new BufferedWriter(new FileWriter(textFile)); for( int wordsv = 1 ; wordsv"; } } while (line !=null); indico.close(); } catch (Exception e){Scroll("error in txtLoad"); } Scroll("end txtcopyartist"); //println("in txtL "+ txtAch); toTextitems(); //2. Save the text String textFile = refDisk + "!!!SITE_WEB\\Artistes_bexcel.txt"; try { BufferedWriter out = new BufferedWriter(new FileWriter(textFile)); String Continent; String GSpec; for (int i = 1 ; i \r\n"); } out.close();} catch (IOException e) {} Scroll(refText + " edited " + String.valueOf(refTextLength)+ "lines"); } void textEditL(){ //teditL pour lettres d'albums println("in textEditL"); //refSubdirectory + "\\" + refText //String textFile = refDisk + refSubdirectory + "\\" + refText + ".html"; String textFile = refDisk + "!!!SITE_WEB\\" + refText + "_" + refWordW + ".html"; // try { BufferedWriter out = new BufferedWriter(new FileWriter(textFile)); for( int wordsv = 1 ; wordsvMaisons-Laffitte")) { //date int d = day(); int m = month(); int y = year(); String s = String.valueOf(d); String prepText = ""; prepText = String.valueOf(d) + " " + monthName[m-1] + " " + String.valueOf(y) ; textLine[wordsv] = textLine[wordsv] + " " + prepText ; } if (textItem[wordsv][0].equals("

Cher(e)")) textLine[wordsv] = textLine[wordsv] + " " + refWordW ; if (textItem[wordsv][0].equals("lignes")) textLine[wordsv] = String.valueOf(hitTypeCard[0]) + " " + textLine[wordsv]; if (textItem[wordsv][0].equals("textes")) textLine[wordsv] = String.valueOf(hitTypeCard[1]) + " " + textLine[wordsv]; if (textItem[wordsv][0].equals("images")) textLine[wordsv] = String.valueOf(hitTypeCard[2]) + " " + textLine[wordsv]; if (textItem[wordsv][0].equals("bandes")) textLine[wordsv] = String.valueOf(hitTypeCard[3]) + " " + textLine[wordsv]; if (textItem[wordsv][0].equals("films")) textLine[wordsv] = String.valueOf(hitTypeCard[4]) + " " + textLine[wordsv]; // String hitTypeName[] = new String[]{"nolink", "texts", "images", "sound", "films"}; //int hitTypeCard[] = new int[6]; out.write( textLine[wordsv]+ " \r\n"); } out.close();} catch (IOException e) {} Scroll(refText + " edited " + String.valueOf(refTextLength)+ "lines"); } void textEditB(){ //teditb println("in textEditB"); String textFile = refDisk + refSubdirectory + "\\" + refText + ".txt"; try { BufferedWriter out = new BufferedWriter(new FileWriter(textFile)); for( int wordsv = 1 ; wordsv0) { locloc = textItem[wordsv][1].length() ; if (locloc>6) { String workAuthorNam_ = ""; if (textItem[wordsv][1].substring(0,4).equals("name")){ workAuthorNam_ = textItem[wordsv][1].substring(6, locloc); workAuthorName = ""; for (int wc = 0; wc3){ if (textItem[wordsv][ll].substring(0,1).equals("(")) break; } } if(readwordscount < 3) {//in case > is alone on its line, then the proper line is just below for (int ll=0; ll<9; ll++) {out.write (textItem[wordsv+1][ll] + " "); if (textItem[wordsv+1][ll].length()>3){ if (textItem[wordsv+1][ll].substring(0,1).equals("(")) break; }} } out.write("par " + workAuthorName +"
\r\n");} Scroll ("filtered : " + textItem[wordsv][0]); } out.close(); } catch (IOException e) {} Scroll(refText + " filtered " + String.valueOf(refTextLength)+ "lines"); } void textFilter2(){//tfilter2. to work on the Oeub file String textFile = refDisk + "Roxame\\" + "data\\" + "Texts" + "\\" + refText + "_filtered_2" + ".html"; String workAuthorName = "author unknown " ; println("lenght " + String.valueOf(refTextLength)); try { BufferedWriter out = new BufferedWriter(new FileWriter(textFile)); out.write("" + " \r\n"); for( int wordsv = 1 ; wordsv0) { //does not applu to the first line locloc = textItem[wordsv][1].length() ; if (locloc>6) { String workAuthorNam_ = ""; if (textItem[wordsv][1].substring(0,4).equals("name")){ workAuthorNam_ = textItem[wordsv][1].substring(6, locloc); workAuthorName = ""; for (int wc = 0; wc3){ if (textItem[wordsv][ll].substring(0,1).equals("(")) break; } } if(readwordscount < 3) {//in case > is alone on its line, then the proper line is just below for (int ll=0; ll<9; ll++) {out.write (textItem[wordsv+1][ll] + " "); if (textItem[wordsv+1][ll].length()>3){ if (textItem[wordsv+1][ll].substring(0,1).equals("(")) break; }} } out.write("par " + workAuthorName +"
\r\n");} Scroll ("filtered : " + textItem[wordsv][0]); } out.close(); } catch (IOException e) {println("error in reading");} Scroll(refText + String.valueOf(refTextLength)+ "lines_done "); } void textDate(){ String prepText = ""; String textFile = refDisk + "Roxame\\data\\Texts\\textedate.txt"; try { BufferedWriter out = new BufferedWriter(new FileWriter(textFile)); int d = day(); int m = month(); int y = year(); String s = String.valueOf(d); prepText = ""; prepText = "

Last update on " + String.valueOf(m) +"/" + String.valueOf(d) + "/" + String.valueOf(y) ; out.write(prepText + "


" + "\r\n"); out.close();} catch (IOException e) {} Scroll("textDate"); } void textConcat(String txtTobecopied){// tconcat //gets a text and copies it ino refText //on a déjà chargé un fichier par textLoad, les lignes étant indetifiées par textLine[] et la longueur par refTextLength println("in txtconcat " + txtTobecopied); println("in txtconcat "+ txtTobecopied); String line = "" ; try{ BufferedReader indico = new BufferedReader(new FileReader(txtTobecopied)); line = ""; refTextLength++; while (line != null) { line = indico.readLine(); println("in concat line " + line); if (line != null) { textLine[refTextLength] = line; refTextLength++ ; } } indico.close(); } catch (Exception e){Scroll("error in tconcat"); } toTextitems(); } void textIndex(int indexColumn){ //list of the subtitles String tach = refDisk + refSubdirectory + "\\Artistes" + String.valueOf(indexColumn) + ".txt" ; textLoad(tach); //,0); String textFile = refDisk + refSubdirectory + "\\" + refText + String.valueOf(indexColumn) + "_index.txt"; try { BufferedWriter out = new BufferedWriter(new FileWriter(textFile)); //

for( int wordsv = 1 ; wordsv" + locName + ", ") ; }//} out.close(); } catch (IOException e) {} } int FileNumberlocate(String fileName, String fileType){ if (fileType.equals("doc")) dirct = refDisk + refSubdirectory + "\\" ; if (fileType.equals("text")) dirct = refDisk + refTextSubdirectory + "\\" ; //println(dirct); File repert = new File(dirct); String[] liste = repert.list(); int Filenumber = 1; boolean fileFound = false ; //println("leng " + String.valueOf(liste.length)); //////while((fileFound == false)&&(Filenumber < liste.length - 1 )) { Filenumber++ ; // if (liste[Filenumber].substring(0, liste[Filenumber].length() - 4).equals(fileName )) fileFound = true; //// } //Scroll(String.valueOf(Filenumber)); return (Filenumber) ; } void nextTextFile() { dirct = refDisk + refTextSubdirectory + "\\" ; File repert = new File(dirct); String[] liste = repert.list(); boolean text_file = false ; boolean end_once_reached = false ; boolean end2 = false; while((text_file == false)&&(end2 ==false)) { try{ if(refTextFilenumber == liste.length - 1 ) { if (end_once_reached == true) {Scroll("no txt file"); end2 = true; } else {refTextFilenumber = 0; end_once_reached = true; }} else { refTextFilenumber++ ; if (liste[refTextFilenumber].substring(liste[refTextFilenumber].length() -3, liste[refTextFilenumber].length()).equals("txt") ) text_file = true; //if (liste[refDocFilenumber].substring(liste[refDocFilenumber].length() -3, liste[refDocFilenumber].length()).equals("jpg") ) jpeg_file = true; } } catch (Exception e){refTextFilenumber++;} } if (text_file == true) { fileTobeloaded = dirct + liste[refTextFilenumber]; textLoad(fileTobeloaded); //,0); refText = liste[refTextFilenumber].substring(0,liste[refTextFilenumber].length() -4); } } void precedTextFile() { dirct = refDisk + refTextSubdirectory +"\\"; File repert = new File(dirct); String[] liste = repert.list(); boolean textFound = false ; boolean end_once_reached = false ; boolean end2 = false; while((textFound == false)&&(end2 ==false)) { if(refTextFilenumber == 0 ) { if (end_once_reached == true) {Scroll("no txt file"); end2 = true; } else {refTextFilenumber = liste.length ; end_once_reached = true; }} else { refTextFilenumber-- ; if (liste[refTextFilenumber].substring(liste[refTextFilenumber].length() -2, liste[refTextFilenumber].length()).equals("xt") ) textFound = true; } } if (textFound == true) { fileTobeloaded = dirct + liste[refTextFilenumber]; textLoad(fileTobeloaded); //,0); refText = liste[refTextFilenumber].substring(0,liste[refTextFilenumber].length() -4); } } void firstTextFile() { dirct = refDisk + refTextSubdirectory +"\\"; File repert = new File(dirct); String[] liste = repert.list(); refTextFilenumber = 1; if (liste[refTextFilenumber].substring(liste[refTextFilenumber].length() -2, liste[refTextFilenumber].length()).equals("xt") ) { fileTobeloaded = dirct + liste[refTextFilenumber]; textLoad(fileTobeloaded) ; //,0); refText = liste[refTextFilenumber].substring(0,liste[refTextFilenumber].length() -4); } else nextTextFile(); } void lastTextFile() { dirct = refDisk + refTextSubdirectory +"\\"; File repert = new File(dirct); String[] liste = repert.list(); refTextFilenumber = liste.length - 1 ; if (liste[refTextFilenumber].substring(liste[refTextFilenumber].length() -2, liste[refTextFilenumber].length()).equals("xt") ) { fileTobeloaded = dirct + liste[refTextFilenumber]; textLoad(fileTobeloaded); //,0); refText = liste[refTextFilenumber].substring(0,liste[refTextFilenumber].length() -4); } else nextTextFile(); } void randomTextFile() // { dirct = refDisk + refTextSubdirectory +"\\"; File repert = new File(dirct); String[] liste = repert.list(); int randnumber = (int) random(10000)%liste.length ; refTextFilenumber = ((int) random(liste.length) * randnumber)%liste.length ; if (liste[refTextFilenumber].substring(liste[refTextFilenumber].length() -3, liste[refTextFilenumber].length()).equals("txt") ) { fileTobeloaded = dirct + liste[refTextFilenumber]; textLoad(fileTobeloaded); //,0); refText = liste[refTextFilenumber].substring(0,liste[refTextFilenumber].length() -4); } else nextTextFile(); } /////////////SCRIPT FILES ///////////////////////////////////////////////////////// void filesDirectory() {///sysftematic work on directories/dico dirct = refDisk + refSubdirectory + "\\"; File repert = new File(dirct); String[] liste = repert.list(); //1. sweep the selected directory for (refDocFilenumber = 0; refDocFilenumber < liste.length ; refDocFilenumber++){ //Opening the file if ((liste[refDocFilenumber].substring(liste[refDocFilenumber].length() -3, liste[refDocFilenumber].length()).equals("JPG") )|| (liste[refDocFilenumber].substring(liste[refDocFilenumber].length() -3, liste[refDocFilenumber].length()).equals("jpg") )){//if it is an image fileTobeloaded = dirct + liste[refDocFilenumber]; refDoc = liste[refDocFilenumber].substring(0,liste[refDocFilenumber].length() -4); ; Scroll(refDoc); println(refDoc); // jpgLoad (dirct + ); Reserve(3); //2. Update the internal dico file int styleAdd = filesDataload(refDoc); //3. measurements and recognibion yescritic = 1; Critique(1); yescritic = 0; Reload(3); typeSelect3(); M(1); //4. updating the dictionary filesDatasave(refDoc, "_"); }}} int filesDataload(String refDocloc){ int wordNumber = 0; // Searching in dico wordNumber = dicoLocate(refDoc); if (wordNumber != 100000) {//this doc is yet present in dico and has been found. 1111111111111111111111111111111111111 Rread(dico[wordNumber][4]); subj_recsu = Integer.parseInt(readword[3]); typeSelected = Integer.parseInt(readword[4]); difgRatio = Integer.parseInt(readword[5]); } else{ //this doc was not yet present in dicco dicoLength++; wordNumber = dicoLength ; dico[wordNumber][0] = refDoc; dico[wordNumber][1] = "doc"; dico[wordNumber][2] = "001"; dico[wordNumber][3] = "000" ; //String.valueOf(globscore); dico[wordNumber][4] = refSubdirectory + " " + "000" + " " + "000" + " " + "000" ; } dicoSave(); return(wordNumber); } void filesDatasave(String refDocloc, String locDirectory){ // Searching in dico Scroll(refDocloc); int wordNumber = dicoLocate(refDocloc); if (locDirectory.equals("_")) locDirectory = refSubdirectory; if (wordNumber == 100000) {//this doc is not yet present in dico dicoLength++; wordNumber = dicoLength ; dico[wordNumber][0] = refDocloc; dico[wordNumber][1] = "doc"; dico[wordNumber][2] = "001";} dico[wordNumber][3] = String.valueOf(globscore); dico[wordNumber][4] = locDirectory + " " + String.valueOf(subj_recsu) + " " + String.valueOf(typeSelected) + " " + String.valueOf(difgRatio); // (diffRatio)/max(1,wwidth*wheight)); dicoSave(); } //================================ void dirList(int listFormat) { //dirlist String textFile= ""; String text_ext = ""; String txtAch = ""; println("in dirlist " + String.valueOf(listFormat)); switch(listFormat){//répertoire à aller lire break; case 1 : case 5 : dirct = refDisk + refSubdirectory + "\\" ; break; } switch(listFormat){ //fichier de sortie case 1 : textFile = refDisk + "dirList.txt"; break; case 5 : textFile = dirct + "dirList.html"; break; } File repert = new File(dirct); //ouverture du répertoire de lecture String[] liste = repert.list(); refDocFilenumber = 0; try { BufferedWriter out = new BufferedWriter(new FileWriter(textFile)); //ouverture du fichier d'écriture switch(listFormat){ //opening case 1 : break; case 5 : out.write(""); break; } while (refDocFilenumber < liste.length -1 ) { println( liste[refDocFilenumber]) ; if (liste[refDocFilenumber].length()<6){} else{ text_ext = liste[refDocFilenumber].substring( liste[refDocFilenumber].length() -4 ) ; txtAch = liste[refDocFilenumber].substring(0, liste[refDocFilenumber].length() -4) ; switch(listFormat){ case 1 : // out.write( "
" + " \r\n") ; break; out.write(liste[refDocFilenumber] + " ") ; if ((text_ext.equals(".jpg"))||(text_ext.equals(".JPG"))||(text_ext.equals(".png"))) out.write("I" + " ") ; else {if ((text_ext.equals(".htm"))||(text_ext.equals(".html"))||(text_ext.equals("HTML"))) out.write("W" + " "); else out.write("T" + " "); } out.write("\r\n"); break ; case 5 : String nonce = String.valueOf( (int) random(10000)); out.write( "
\r\n"); break; }} refDocFilenumber++; } switch(listFormat){ //end of the file case 1 : break; case 5 : out.write(""); break; } out.close(); } //end of try catch (IOException e) {} } void dirRename(int listFormat) { //dirrename PImage b; //String docach = refDisk + "Famille\\Berger-Delorme\\NM\\nicolemichel_50ans_001.jpg" ; String docach = refDisk + "Famille\\Berger-Delorme\\Mariage\\BA2012.jpg" ; File repert = new File(dirct); String[] liste = repert.list(); String textFile= ""; String newName = ""; refDocFilenumber = 0; String locLine = "" ; int save_x = 0; int save_y = 0;; try{ b = loadImage(docach); } catch(Exception e) { b = loadImage(refDisk + "Roxame/!!!temp0.BMP"); Scroll("in b_load, not OK"); } docWidth = b.width; docHeight = b.height ; String docSav = refDisk + "Famille\\Berger-Delorme\\Mariage\\NNBA2012.jpg"; for (int i = 0; i"); for( int wordsv = 1 ; wordsv 5) { branchName = ""; brIndex = textItem[wordsv][6].length(); while( (!(textItem[wordsv][6].substring(brIndex-1, brIndex).equals("/"))) && (brIndex>3)) brIndex--; out.write(" " + textItem[wordsv][6].substring(1,brIndex-1) + " "); } for (int j = 3; j \r\n") ; } out.write(""); out.close(); } //end of try catch (IOException e) {} } void textFilter3(){ //tfilter3. to clean HTML files //the task is : to remove all marks <...> String textFile = refDisk + "Roxame\\" + "data\\" + "Texts" + "\\" + refText + "_3" + ".txt"; // String textFile = refDirectory + "data\\" + "Texts" + "\\" + refText + "_3" + ".txt"; String locLine = ""; String locChar = ""; String copyLine = ""; int charNum = 0; int charSecnum = 0 ; boolean inBeacon = false; println("in tfilter 3. lenght " + String.valueOf(refTextLength)) ; try { BufferedWriter out = new BufferedWriter(new FileWriter(textFile)); for( int wordsv = 1 ; wordsv")) inBeacon = false; } out.write( copyLine + " \r\n" ) ; println(locLine); println(copyLine); } out.close(); }catch(Exception e){println("Ah Ah");} } /* Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License. */