Implemented generic N-gram visualization instead of separate methods.