/*
* Test phrase: The biowalls catch bad odours and spread natural scents.
*/

module.exports = function(ruleManager, sentence, result) {

    if (!result || !result.tokenIndices || !sentence || result.tokenIndices.length<2)
    {
        console.log("no data");
        return false;
    }

    let nounToTransformId = result.tokenIndices[1];

    if (!sentence.basicDependencies){
        console.log("basic dependencies are not activated");
        debugger;
        return false;
    }

    for (i=0; i < sentence.basicDependencies.length; i++) {
        let bd = sentence.basicDependencies[i];
        if (bd.dep == "dobj" && bd.governor == nounToTransformId+1){
            var overload = {
                type: "att",
                object: "token",
                tokenIndices: [result.tokenIndices[1]],
                modifications: {
                    "pos": "VBP"
                }
            };
            ruleManager.AddOverload(result, overload);
            return true;

        }

    }
    
    return false;

}