--[[----------------------------------------------------------------------------

This Any Filter Code criterion script returns true if the current photo 
has a Person keyword with no corresponding face rectangle tagged with that
keyword.

All matching photos, including the keyword names, are logged in "debug.log"
in the "anyfilter.lrplugin" folder.

Referenced fields: Faces, ExplicitKeywords
------------------------------------------------------------------------------]]

local faceSet = {}
for _, face in ipairs (Faces) do faceSet [face.Name] = true end

for _, keyword in ipairs (ExplicitKeywords) do
    local name = keyword.Keyword:getName ()
    if keyword.Person and not faceSet [name] then 
        Debug.logn ("\n", name, photo.path)
        return true 
        end
    end

return false
