import ctext.*; CAnalyze analyze; CTextInput input; CText ctext, ctexts[]; void setup() { size(400, 400); // create seom ctexts ctexts = new CText[5]; ctext = new CText(this,width/2, 117); // create input and analyzer input = new CTextInput(this, 150,125); analyze = new CAnalyze(this); // run a little test onTextInput("type a phrase here"); } void draw() { background(200); CText.drawAll(); } // called when 'enter' is typed void onTextInput(String s) { ctext.setText("(input) "+s); analyze.setText(s); // clean up the old ones CText.dispose(ctexts); // get & display the extracted features int yPos = 150; ctexts[0] = new CText(this, "(words) "+analyze.getFeature("words"), width/2, yPos += 20); ctexts[1] = new CText(this, "(syllables) "+analyze.getFeature("syllables"), width/2, yPos += 20); ctexts[2] = new CText(this, "(phonemes) "+analyze.getFeature("phonemes"), width/2, yPos += 20); ctexts[3] = new CText(this, "(pos-tags) "+analyze.getFeature("pos"), width/2, yPos += 20); ctexts[4] = new CText(this, "(stresses) "+analyze.getFeature("stresses"), width/2, yPos += 20); }