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).

!7

sclass SelectBot<A> {
  new TreeMap<S, A> examples;
  
  void put(S s, A value) { examples.put(s, value); }

  A get(S s) {
    ret examples.get(levenClosestIC(examples, s));
  }
}

p {
  new SelectBot<S> bot;
  bot.put("yes", "ja");
  bot.put("no", "nein");
  print(bot.get("yessss"));
  print(bot.get("nooooo"));
}

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: 509 / 581
Version history: 1 change(s)
Referenced in: [show references]