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

19
LINES

< > BotCompany Repo | #300 // Ranker that excludes really boring results (nil etc)

Lua code

get("#265") -- json.encode, json.decode

function acceptable(e)
  local r = e.r_result
  if r == 'nil' or r == 'I hate it!'
    --[[or r == 'I like it!']] then return false end
  if string.find(r, "^org.luaj.vm2.LuaError") then return false end
  return true
end

lst = json.decode(input)
newlst = {}
for _, e in ipairs(lst) do
  if acceptable(e) then
    table.insert(newlst, e)
  end
end

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

Image recognition results

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: 1166 / 227
Referenced in: [show references]