You are currently viewing Java: Wooden Language

Java: Wooden Language

The program below uses the typical expressions of the so called “wooden language” which is actually talking with impressive expressions but finally say nothing. I was originally inspired from the article in the attached photo.

It is consisted of 4 sets of 10 sequential expressions, which can construct a sentence at any possible combination. Thus,  we have actually 10 x 10 x 10 x 10 = 10000 combinations, which are finally outputted on a file in D:\.

The program initially produces all the combinations and sets them in an array. Then randomly removes one by one. For this reason we use ArrayList, which supports trimToSize() method, which reduces the size of array every time some element is removed.

Then with the use of FileWriter and BufferedWritter it produces the file: wooden_lang.txt. The produced text pasted in Word Document reaches finally 578 pages!


package vag;

import java.util.ArrayList;
import java.util.Hashtable;
import java.io.IOException;
import java.io.BufferedWriter;
import java.io.FileWriter;

public class WoodenLang2 {

public static java.util.Random generator;

int aSeq = 0;
int bSeq = 0;
int cSeq = 0;
int dSeq = 0;

int aSeqHist = 0;
int bSeqHist = 0;
int cSeqHist = 0;
int dSeqHist = 0;

int initSeq = 0;

String A[]={"Ladies and gentlemen",
//Κυρίες και κύριοι
"Daily practice has shown that",
//Η καθημερινή πρακτική έχει αποδείξει ότι
"By this way",
//Κατά τον τρόπο αυτό
"The careful organization and especially",
//Η επιμέλεια της οργάνωσης και προπάντων
"On the other side",
//Από την άλλη πλευρά
"At the same time",
//Ταυτόχρονα
"We should not forget the fact that",
//Δεν πρέπει όμως να μας διαφεύγει ότι
"Needless to underline the importance of these elements because",
//Περιττεύει να υπογραμμίσω την σημασία αυτών των στοιχείων γιατί
"The diverse and rich experience and",
//Η πολύμορφη και πλούσια εμπειρία αλλά και
"The ideological criteria when combined and"};
//Τα ιδεολογικά κριτήρια όταν συνδιαστούν και

String B[]={"the achievement of the objectives we have set",
//η πραγμάτωση των στόχων που έχουμε θέσει
"the extent and method of formation of the strains",
//η έκταση και η μέθοδος διαμόρφωσης των στελεχών
"the steady increase in quality and quantity of our efforts",
//η σταθερή άνοδος στην ποιότητα και την ποσότητα των προσπαθειών μας
"the present structure of this system",
//η παρούσα δομή του συστήματος αυτού
"a new model of multilateral action",
//ένα νέο μοντέλο πολύπλευρης δράσης
"the development of our diverse business",
//η ανάπτυξη της ποικιλόμορφης δραστηριότητάς μας
"Our commitment to the continued practice of documentation and information",
//η αδιάκοπη προσήλωσή μας στην πρακτική της τεκμηρίωσης και ενημέρωσης
"the strengthening and expansion of structures",
//το δυνάμωμα και η επέκταση των δομών
"the broad participation of the masses to the relevant processes",
//η πλατιά συμμετοχή των λαϊκών μαζών στις σχετικές επεξεργασίες
"with the start of a decisive campaign"};
//με το ξεκίνημα μιας αποφασιστικής καμπάνιας

String C[]={"requires us to analyze carefully and consciously",
//μας επιβάλλει να αναλύσουμε προσεκτικά και συνειδητά
"plays an important role to determine",
//παίζει σημαντικό ρόλο για να καθορίσουμε
"requires us to identify and define",
//μας υποχρεώνει να προσδιορίσουμε και να καθορίσουμε
"helps us to prepare and digest",
//μας βοηθάει να προετοιμάσουμε και να αφομοιώσουμε
"guarantee the widest possible appeal to process",
//εγγυάται την ευρύτερη δυνατή απήχηση ώστε να επεξεργαστούμε
"contributes decisively to mark",
//συμβάλλει με τρόπο αποφασιστικό ώστε να σηματοδοτήσει
"decicively helps our effort to consolidate",
//βοηθάει αποφασιστικά στην προσπάθεια να στερεώσουμε
"give us a high degree of discretion to assess",
//μας δίνουν σε μεγάλο βαθμό την ευχέρεια να εκτιμήσουμε
"are a very important basis for",
//αποτελούν μια πολύ σημαντική βάση για
"initiate a process that helps to refine"};
//εγκαινιάζουν μια διεργασία που συμβάλλει στο να τελειοποιήσουμε

String D[]={"the existing social conditions and institutional settings",
//τις υπάρχουσες κοινωνικές συνθήκες και τα θεσμικά πλαίσια
"the pillars of our future course",
//τους άξονες της μελλοντικής μας πορείας
"a general system of broad participation",
//ένα γενικότερο σύστημα πλατιάς συμμετοχής
"the new trends and directions to the challenges of the times",
//τις νέες τάσεις και κατευθύνσεις απέναντι στις πρόκληση των καιρών
"the new components and coordinates",
//τις νέες συνιστώσες και συντεταγμένες
"the foundations of a progressive evolution",
//τις βάσεις μιας προοδευτικής μετεξέλιξης
"a dynamic system to address major new requirements of our time",
//ένα δυναμικό σύστημα αντιμετώπισης των νέων μεγάλων απαιτήσεων του καιρού μας
"the best possible conditions for the acceleration of our work",
//τις καλύτερες δυνατές συνθήκες για την επιτάχυνση του έργου μας
"a new development model",
//ένα καινούργιο μοντέλο ανάπτυξης
"the various support our influence"};
//τις διάφορες μορφές ενίσχυσης της επιρροής μας

public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
generator = new java.util.Random(99999999);
WoodenLang2 wl2 = new WoodenLang2();
FileWriter fstream = new FileWriter("d:\\wooden_lang.txt");
BufferedWriter out = new BufferedWriter(fstream);
wl2.runWL2(out);
out.close();
}

public Hashtable phraseHashtable(){
Hashtable ht = new Hashtable();
String phrase = "";
int comboNum = 0;
for(int w=0;w<A.length;w++){
for(int x=0;x<B.length;x++){
for(int y=0;y<C.length;y++){
for(int z=0;z<D.length;z++){
phrase = A[w] + " " + B[x] + " " + C[y] + " " + D[z] + ".";
ht.put(comboNum, phrase);
comboNum++;
//System.out.println(phrase);
phrase="";
}
}
}
}
return ht;
}

public void runWL2(BufferedWriter bf) throws IOException {
int randomNum = 0;
int paragraphCount = 0;
String currentStart="";
String previousStart="";
WoodenLang2 wl2 = new WoodenLang2();
Hashtable pc = wl2.phraseHashtable();
Hashtable pc2 = new Hashtable();

ArrayList<String> al = new ArrayList<String>();
al.addAll(pc.values());

while(al.size()>0){
randomNum = generator.nextInt(al.size());
//System.out.println(al.get(randomNum));
if(paragraphCount==0){
bf.write("\t");
}
else{
bf.write(" ");
}
//currentStart=al.get(randomNum).substring(0,10);
//while()
bf.write(al.get(randomNum));
al.remove(randomNum);
al.trimToSize();
previousStart=currentStart;
paragraphCount++;

if(paragraphCount==10){
bf.write("\r\n\r\n");
paragraphCount=0;
}
}
}
}


Ξύλινη γλώσσα: Πως να μιλάτε χωρίς να λέτε τίποτα

wooden language

Leave a Reply