!7 static JTextArea ta; static L usedConcepts; p-substance { aiEnhancements(); usedConcepts = findAIConcepts( "rplldtbwbbnlrotj kjuwvfidiwmbjsuc xzhtvnqwzuuzixci mibnjwgfxnetaxyz cdtwmxtqspigpyap kdpoqkaoypqenusd"); sentencesToCL([[ "!" is a typical first word in a program. "Hello" is a typical first word in a letter. cdtwmxtqspigpyap confirms mibnjwgfxnetaxyz. ]]); ta = showText(""); onChangeAndNow(ta, r { fS text = getText(ta); thread { think(text); } }); requestFocus(ta); } sS firstWord(S s) { if (empty(s)) ret ""; if (isLetterOrDigit(first(s))) ret takeCharsWhile(s, f isLetterOrDigit); else ret "" + first(s); } svoid think(S text) { time { S w = firstWord(text); S x = aGlobalID(); /* w is the first word in x. Is x a letter (1) or a program (2)? */ S riddle = quote(w) + " is the first word in " + x + ". Is " + x + " a letter (1) or a program (2)?"; sentencesToCL(riddle); } } static L sentencesToCL(S text) { L l = splitIntoSentences(text); englishToConceptLanguage_concepts.set(usedConcepts); new L out; for (S line : l) { S c = englishToConceptLanguage(line); print(line + " => " + c); out.add(c); } ret out; }