text: public virtual NormalizeCharMap Build(){FST<CharsRef> map;try{Outputs<CharsRef> outputs = CharSequenceOutputs.Singleton;Builder<CharsRef> builder = new Builder<CharsRef>(FST.INPUT_TYPE.BYTE2, outputs);Int32sRef scratch = new Int32sRef();foreach (var ent in pendingPairs){builder.Add(Lucene.Net.Util.Fst.Util.ToUTF16(ent.Key, scratch), new CharsRef(ent.Value));}map = builder.Finish();pendingPairs.Clear();}catch (IOException ioe){throw new Exception("Should never happen", ioe);}return new NormalizeCharMap(map);}