Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

35
LINES

< > BotCompany Repo | #1014125 // VisualKatze 2 [Association Machine, OK, run with #1013936]

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Uses 4281K of libraries. Click here for Pure Java version (7902L/54K/196K).

!7

static JLabel l;
static Map<S> consequentsMap = synchroCIMap();

p-noconsole {
  autoUpdate();
  
  final JFrame frame = showMaximizedFrame(jscroll_verticalExtend_trackWidth(jTiledBackground(#1007195,
    setForeground(Color.white, setFontSize(120, l = jcenteredlabel())))));
    
  final VF1<S> toConsequentsMap = consequentsMap_receiver(consequentsMap);
  time "Loading" {
    loading {
      mapVoid(toConsequentsMap, dropLast(linesOfFile(speechRecognitionLog())));
    }
  }
  
  tailFileLinewisePlusLastLine(speechRecognitionLog(), 100, voidfunc(S utterance) {
    utterance = trimLastLine(utterance);
    if (!isProperlyQuoted(utterance)) ret;
    utterance = unquote(utterance);
    if (empty(utterance)) ret;
    print(">> " + utterance);
    utterance = trimSubstring(utterance, indexOf(utterance, ']')+1);
    
    toConsequentsMap.get(utterance);
    S answer = consequentsMap.get(utterance);
    if (nempty(answer))
      utterance += "\n\n" + answer;
    
    setTitle(frame, utterance);
    setText(l, jlabel_textAsHTML_center(utterance))
  });
}

Author comment

Began life as a copy of #1014110

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1014125
Snippet name: VisualKatze 2 [Association Machine, OK, run with #1013936]
Eternal ID of this version: #1014125/16
Text MD5: 6cd66a43bb95343dd6a63b8a96a530df
Transpilation MD5: a0302dc8c17bdc12596ea0d567052b99
Author: stefan
Category: javax / gui
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-04-11 04:56:34
Source code size: 1098 bytes / 35 lines
Pitched / IR pitched: No / No
Views / Downloads: 415 / 708
Version history: 15 change(s)
Referenced in: #1014131 - VisualKatze 3 [Association Machine, Forward+Backward, OK, run with #1013936]