To configure Lua post-processing tasks, you must specify the number of tasks and task names in the [PostProcessingTasks]
section of the configuration file, for example:
[PostProcessingTasks] numTasks=2 task0=checksum task1=filterscore
Each task must also have its own section in the configuration file, for example:
[checksum] type=lua script=./scripts/checksum.lua entities=number/creditcard
You must define a processmatch
function in your script:
function processmatch (edkmatch)
where edkmatch
is the object to match. This returns a Boolean value; set this to True
to keep the match, or False
to discard it.
The following methods and parameters are available:
edkmatch:getEntityName(), edkmatch:setEntityName(new_name)
edkmatch:getOutputText(), edkmatch:setOutputText(new_text)
edkmatch:getMatchedText(), edkmatch:setMatchedText(new_text)
edkmatch:getOffset(), edkmatch:setOffset(new_offset)
edkmatch:getOffsetLength(), edkmatch:setOffsetLength(new_length)
edkmatch:getScore(), edkmatch:setScore(new_score)
edkmatch:getComponentCount()
edkmatch:getComponent(index)
edkcomponent:getName(), edkcomponent:setName(new_name)
edkcomponent:getText(), edkcomponent:setText(new_text)
edkmatch:addComponent(name, offset, offsetLength)
For more information, see Eduction Lua Methods Reference.
|