1 | // for stuff like #1000351 |
2 | |
3 | static class LMap extends LearnerImpl {
|
4 | static boolean debug; |
5 | Map<String, String> map = new TreeMap<String, String>(); |
6 | |
7 | public void processInOut(Object _in, Object _out) {
|
8 | List<String> in = cast _in; |
9 | List<String> out = cast _out; |
10 | |
11 | if (in.size() != out.size()) fail(); |
12 | |
13 | for (int i = 0; i < in.size(); i++) {
|
14 | String a = in.get(i), b = out.get(i); |
15 | if (!a.equals(b)) |
16 | map.put(a, b); |
17 | } |
18 | } |
19 | |
20 | public Object processIn(Object _in) {
|
21 | List<String> in = cast _in; |
22 | new List<String> out; |
23 | for (int i = 0; i < in.size(); i++) {
|
24 | String a = in.get(i), b = map.get(a); |
25 | out.add(b != null ? b : a); |
26 | } |
27 | return out; |
28 | } |
29 | } |
Began life as a copy of #1000485
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
2 comment(s) hidden. show
| Snippet ID: | #1000486 |
| Snippet name: | LMap (developing) |
| Eternal ID of this version: | #1000486/1 |
| Text MD5: | 7b1f65e8bdf21e6e9bc399283ec5d8d7 |
| Author: | stefan |
| Category: | |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2015-08-09 02:58:41 |
| Source code size: | 742 bytes / 29 lines |
| Pitched / IR pitched: | No / Yes |
| Views / Downloads: | 1219 / 2153 |
| Referenced in: | [show references] |