code: func (b *Builder) Finish() (*FST, error) {
  	root := b.frontier[0]
  
  	// minimize nodes in the last word's suffix
  	err := b.freezeTail(0)
  	if err != nil {
  		return nil, err
  	}
  	if root.InputCount < int64(b.minSuffixCount1) ||
  		root.InputCount < int64(b.minSuffixCount2) || root.NumArcs == 0 {
  		if b.fst.emptyOutput == nil {
  			return nil, nil
  		} else if b.minSuffixCount1 > 0 || b.minSuffixCount2 > 0 {
  			// emtpy string got pruned
  			return nil, nil
  		}
  	} else {
  		if b.minSuffixCount2 != 0 {
  			err = b.compileAllTargets(root, b.lastInput.Length())
  			if err != nil {
  				return nil, err
  			}
  		}
  	}
  	d, err := b.compileNode(root, b.lastInput.Length())
  	if err != nil {
  		return nil, err
  	}
  	err = b.fst.finish(d.node)
  	if err != nil {
  		return nil, err
  	}
  
  	if b.doPackFST {
  		n := b.fst.NodeCount() / 4
  		if n < 10 {
  			n = 10
  		}
  		return b.fst.pack(3, int(n), b.acceptableOverheadRatio)
  	}
  	return b.fst, nil
  }
docs: /*
  Returns final FST. NOTE: this will return nil if nothing is accepted
  by the FST.
  */