@Override public void init(boolean expensive) {
    super.init(expensive);
    if( _parms._regex == null ) {
      error("_regex", "regex is missing");
    } else {
      try { _pattern = Pattern.compile(_parms._regex); }
      catch( PatternSyntaxException pse ) { error("regex", pse.getMessage()); }
    }
    if( _parms._train == null ) return;
    Vec[] vecs = _parms.train().vecs();
    if( vecs.length != 1 )
      error("_train","Frame must contain exactly 1 Vec (of raw text)");
    if( !(vecs[0] instanceof ByteVec) )
      error("_train","Frame must contain exactly 1 Vec (of raw text)");
  }
@ Override public void init ( boolean expensive ) { super . init ( expensive ) ; if ( _parms . _regex == null ) { error ( "_regex" , "regex is missing" ) ; } else { try { _pattern = Pattern . compile ( _parms . _regex ) ; } catch ( PatternSyntaxException pse ) { error ( "regex" , pse . getMessage ( ) ) ; } } if ( _parms . _train == null ) return ; Vec [ ] vecs = _parms . train ( ) . vecs ( ) ; if ( vecs . length != 1 ) error ( "_train" , "Frame must contain exactly 1 Vec (of raw text)" ) ; if ( ! ( vecs [ 0 ] instanceof ByteVec ) ) error ( "_train" , "Frame must contain exactly 1 Vec (of raw text)" ) ; }
Initialize the ModelBuilder, validating all arguments and preparing the
training frame.  This call is expected to be overridden in the subclasses
and each subclass will start with "super.init();".  This call is made
by the front-end whenever the GUI is clicked, and needs to be fast;
heavy-weight prep needs to wait for the trainModel() call.

Validate the regex.