1 | !752 |
2 | |
3 | static MultiMap<S, S> shortDefinitions; |
4 | |
5 | p {
|
6 | load("shortDefinitions");
|
7 | } |
8 | |
9 | synchronized answer {
|
10 | if (!tb()) null; |
11 | |
12 | if "a * is a *" {
|
13 | S in = toLowerCase(m.unq(0), out = toLowerCase(m.unq(1)); |
14 | if (shortDefinitions.containsPair(in, out)) |
15 | ret "I know"; |
16 | shortDefinitions.put(in, out); |
17 | ret "OK!"; |
18 | } |
19 | |
20 | if "a * is not a *" {
|
21 | S in = toLowerCase(m.unq(0)); |
22 | if (eqic(shortDefinitions.get(in), m.unq(1))) {
|
23 | shortDefinitions.remove(in); |
24 | ret "Removed!"; |
25 | } |
26 | } |
27 | |
28 | if "what is a *" {
|
29 | S in = toLowerCase(m.unq(0)); |
30 | S out = shortDefinitions.get(in); |
31 | if (nempty(out)) |
32 | ret format("A * is a *", in, out);
|
33 | } |
34 | } |
Began life as a copy of #1002991
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: | #1002995 |
| Snippet name: | TB Multi Definitions Bot (dev.) |
| Eternal ID of this version: | #1002995/1 |
| Text MD5: | 75bd8e12d58aa4f2167a4b0e6fa4c880 |
| Author: | stefan |
| Category: | eleu / nl |
| Type: | JavaX source code |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2016-04-15 22:01:53 |
| Source code size: | 704 bytes / 34 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 848 / 780 |
| Referenced in: | [show references] |