Add the setDimension() interface for NGram structure.