Identifying gerund phrases and determining noun function