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

19
LINES

< > BotCompany Repo | #1008053 // SelectBot Test [WORKS]

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

Libraryless. Click here for Pure Java version (1112L/8K/26K).

1  
!7
2  
3  
sclass SelectBot<A> {
4  
  new TreeMap<S, A> examples;
5  
  
6  
  void put(S s, A value) { examples.put(s, value); }
7  
8  
  A get(S s) {
9  
    ret examples.get(levenClosestIC(examples, s));
10  
  }
11  
}
12  
13  
p {
14  
  new SelectBot<S> bot;
15  
  bot.put("yes", "ja");
16  
  bot.put("no", "nein");
17  
  print(bot.get("yessss"));
18  
  print(bot.get("nooooo"));
19  
}

Author comment

Began life as a copy of #1008050

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: #1008053
Snippet name: SelectBot Test [WORKS]
Eternal ID of this version: #1008053/2
Text MD5: 5fb7b578c59a5232a7b40764fcfc0aa5
Transpilation MD5: 0e1d14ddeb5c03f202ea54153c0b3d1d
Author: stefan
Category: javax / a.i.
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-04-23 00:08:49
Source code size: 338 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 510 / 582
Version history: 1 change(s)
Referenced in: [show references]