added the gram option in extractfeature.py