/*
* Test phrase: Unesco grants cultural status to traditions including raggae and the Irish sport of hurling.
*/

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 bdi = sentence.basicDependencies[i];
        if (bdi.dep == "nsubj" && bdi.governor == nounToTransformId+1 && bdi.dependent == nounToTransformId){
            var overload = {
                type: "att",
                object: "token",
                tokenIndices: [result.tokenIndices[1]],
                modifications: {
                    "pos": "VBZ"
                }
            };
            ruleManager.AddOverload(result, overload);
            return true;
        }

    }
    
    return false;

}