patternize(1)                                                    patternize(1)



NAME
       patternize - generate random strings matching a pattern

SYNOPSIS
       patternize [OPTIONS] PATH

DESCRIPTION
       patternize  reads  configuration from PATH and writes a randomly chosen
       string matching one of the patterns found there to standard output.

OPTIONS
       -n, --number COUNT
              The number of strings to generate.  The default is 1.

       -h, --help
              Display a usage message.

       -V, --version
              Display a version string.

CONFIGURATION
       Configuration may either be a single file or it may be a directory.  In
       the  latter  case,  the  files in the directory are read lexical order.
       Backup files (containing ~) and dotfiles are skipped.

       Configuration consists of a collection of sections.   Sections  have  a
       type and possibly a name:

              [TYPE]
              [TYPE NAME]

       Types  and  names are both nonempty sequences of ASCII letters and dig‐
       its.  A section ends either when a new section is introduced or at  the
       end of a file.

   Patterns
       A  patterns  section contains a list of pattern strings, one to a line.
       In a pattern string every character stands for  itself  except  for  $,
       which  either  introduces  a substitution of the form ${CATEGORY} or is
       doubled as $$ to represent a single $ symbol.

       Patterns sections do not have names.  All patterns  sections  are  con‐
       catenated together.

   Categories
       A  category section always has a name, which can be used in the substi‐
       tutions referred to above.  The section contains  a  list  of  possible
       substitution strings for this category, one to a line.

       All the category sections with a given name are concatenated together.

   Configuration
       A config section defines other configuration settings.  Each line has a
       single configuration setting:

              NAME=VALUE

       Supported configuration settings are:

       distribution
              Defines how generated strings are picked.  The  possible  values
              are:

              uniform
                     Picks  uniformly  from  all  possible  generated strings.
                     This is the default.

              twolevel
                     Picks uniformly among patterns and then  uniformly  among
                     the strings generated by that pattern.

              The  uniform  distribution  is  a  bit  slower to calculate than
              twolevel and will inflate the incidence of patterns which gener‐
              ate many strings (for instance, because they have more substitu‐
              tions) in a way that can be displeasing.

LOCALIZATION
       All input files are assumed to follow the current  multibyte  character
       encoding.



                                                                 patternize(1)