Migrate the workflow of NGram to plugin system.