code: private Pattern createPattern(String smarts, IChemObjectBuilder builder) throws IOException {
          SmartsPattern ptrn = SmartsPattern.create(smarts, builder);
          ptrn.setPrepare(false); // avoid redoing aromaticity etc
          return ptrn;
      }
docs: Create a pattern for the provided SMARTS - if the SMARTS is '?' a pattern
  is not created.
  
  @param smarts  a smarts pattern
  @param builder chem object builder
  @return the pattern to match