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

35
LINES

< > BotCompany Repo | #1014131 // VisualKatze 3 [Association Machine, Forward+Backward, OK, run with #1013936]

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

Uses 4281K of libraries. Click here for Pure Java version (7958L/55K/198K).

1  
!7
2  
3  
static JLabel l;
4  
static Map<S> consequentsMap = synchroCIMap(), precedentsMap = synchroCIMap();
5  
6  
p-noconsole {
7  
  autoUpdate();
8  
  
9  
  final JFrame frame = showMaximizedFrame(jscroll_verticalExtend_trackWidth(jTiledBackground(#1007195,
10  
    setForeground(Color.white, setFontSize(120, l = jcenteredlabel())))));
11  
    
12  
  final L<VF1<S>> receivers = ll( 
13  
    consequentsMap_receiver(consequentsMap), precedentsMap_receiver(precedentsMap));
14  
  time "Loading" {
15  
    loading {
16  
      mapVoidMulti(receivers, map unquoteAndDropAngleBracketStuff(dropLast(linesOfFile(speechRecognitionLog()))));
17  
    }
18  
  }
19  
  
20  
  tailFileLinewisePlusLastLine(speechRecognitionLog(), 100, voidfunc(S utterance) {
21  
    utterance = trimLastLine(utterance);
22  
    utterance = unquoteAndDropAngleBracketStuff(utterance);
23  
    if (empty(utterance)) ret;
24  
    print(">> " + utterance);
25  
26  
    mapVoidMulti(receivers, ll(utterance));
27  
    S answer = consequentsMap.get(utterance);
28  
    if (empty(answer)) answer = precedentsMap.get(utterance);
29  
    if (nempty(answer))
30  
      utterance += "\n\n" + answer;
31  
    
32  
    setTitle(frame, utterance);
33  
    setText(l, jlabel_textAsHTML_center(utterance))
34  
  });
35  
}

Author comment

Began life as a copy of #1014125

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: #1014131
Snippet name: VisualKatze 3 [Association Machine, Forward+Backward, OK, run with #1013936]
Eternal ID of this version: #1014131/8
Text MD5: 9de4cb70766e2e08403547c7cd137437
Transpilation MD5: b88ed98bce1ec1e972ac4c771853d333
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 05:18:52
Source code size: 1187 bytes / 35 lines
Pitched / IR pitched: No / No
Views / Downloads: 386 / 528
Version history: 7 change(s)
Referenced in: [show references]