1 | get("#265") -- json.encode, json.decode
|
2 | |
3 | function acceptable(e) |
4 | local r = e.r_result |
5 | if r == 'nil' or r == 'I hate it!' |
6 | --[[or r == 'I like it!']] then return false end |
7 | if string.find(r, "^org.luaj.vm2.LuaError") then return false end |
8 | return true |
9 | end |
10 | |
11 | lst = json.decode(input) |
12 | newlst = {}
|
13 | for _, e in ipairs(lst) do |
14 | if acceptable(e) then |
15 | table.insert(newlst, e) |
16 | end |
17 | end |
18 | |
19 | return json.encode(newlst) |
test run test run with input download show line numbers
Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
2 comment(s) hidden. show
| Recognizer | Recognition Result | Visualize | Recalc |
|---|---|---|---|
| #308 | 435 | [visualize] |
| Snippet ID: | #300 |
| Snippet name: | Ranker that excludes really boring results (nil etc) |
| Eternal ID of this version: | #300/1 |
| Text MD5: | 7ad37b43f78ac9200077286a9a4075db |
| Author: | stefan |
| Category: | image recognition rankers |
| Type: | Lua code |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2014-12-08 21:04:24 |
| Source code size: | 435 bytes / 19 lines |
| Pitched / IR pitched: | No / Yes |
| Views / Downloads: | 1848 / 323 |
| Referenced in: | [show references] |