text: public override void Build(IInputIterator iterator){if (iterator.HasPayloads){throw new ArgumentException("this suggester doesn't support payloads");}if (iterator.HasContexts){throw new ArgumentException("this suggester doesn't support contexts");}count = 0;var scratch = new BytesRef();IInputIterator iter = new WFSTInputIterator(this, iterator);var scratchInts = new Int32sRef();BytesRef previous = null;var outputs = PositiveInt32Outputs.Singleton;var builder = new Builder<long?>(FST.INPUT_TYPE.BYTE1, outputs);while ((scratch = iter.Next()) != null){long cost = iter.Weight;if (previous == null){previous = new BytesRef();}else if (scratch.Equals(previous)){continue; }Lucene.Net.Util.Fst.Util.ToInt32sRef(scratch, scratchInts);builder.Add(scratchInts, cost);previous.CopyBytes(scratch);count++;}fst = builder.Finish();}