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

26
LINES

< > BotCompany Repo | #1020016 // Show Definitions Per Word In Input [OK]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Libraryless. Click here for Pure Java version (14596L/101K).

1  
!7
2  
3  
module DefinitionsPerWord > DynTextArea {
4  
  transient S input;
5  
  
6  
  start {
7  
    dm_onTopInputChangeAndNow_q(voidfunc(S s) {
8  
      input = s;
9  
      update();
10  
    });
11  
    doEvery(10.0, r updateMe);
12  
  }
13  
  
14  
  void update {
15  
    Map<S, LS> map = dm_getDefinitionsMap();
16  
    new LS out;
17  
    out.add(input + "\n");
18  
    for (S word : words(input)) {
19  
      LS defs = map.get(word);
20  
      if (empty(defs)) defs = ll("?");
21  
      for (S d : defs)
22  
        out.add(word + " = " + d);
23  
    }
24  
    setText(lines(out));
25  
  }
26  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 9 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1020016
Snippet name: Show Definitions Per Word In Input [OK]
Eternal ID of this version: #1020016/5
Text MD5: d46aa7c1b1c091fda1736ac48c5c7aa4
Transpilation MD5: 6fda880ad66b24058604b751fe3ae53f
Author: stefan
Category: javax / a.i.
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-12-04 16:46:37
Source code size: 534 bytes / 26 lines
Pitched / IR pitched: No / No
Views / Downloads: 240 / 729
Version history: 4 change(s)
Referenced in: [show references]