Word Flow

To allow supporting multiple dialects or even whole language families in a single specification, tadpole offers tools for controlling what rules get applied to words and how to pull words into and out of the transformations.

Outputs

Outputs allow writing out intermediate steps of the sound change sequence. By default, there is one implicit output at the end of the file. Adding additional outputs never overrides the final result, but produces additional output data which can be read from the full result.

In their simplest form, an output consists of a name and a rule:

output out1 = !() -> ();

In this example, the rule !() -> () is a no-op, since !() never matches. Using output rules like this can be used to output a romanized form. Compound rules can be used, so even complex transformations are possible in outputs.

The result of rules in outputs is only used for the output value, and does not carry over into subsequent rules.

Outputs can also display the internal segmentation information, for example to show syllable breaks in your intermediate steps. For the typical case of showing syllable data, this might be written as follows:

output out2 = segmentation with ('' '.' ' ');

The three symbols in the parentheses of this format are used to specify the characters inserted between symbols, syllables, and words respectively.

Finally, to use both a rule and segmentation display, both can be written in curly braces:

output out3 = {
  rule = 'a' -> 'b';
  segmentation with (' ' '.' '   ');
}

The segmentation and rule parts of this construct can be in either order, but segmentation display is always applied after the rule.

Inputs

Inputs allow words to enter the transformation sequence at various points and from various forms. By default, words enter the transformation sequence at the start without any modification and with the syllable and segmentation settings active at the time of the first rule.

Inputs, like outputs, may be just a rule:

input in1 = !() -> ();

Using a null rule like this allows using inputs for simply starting the transformation at a later point.

For more advanced applications, the block form of inputs can be used and allows specifying segmentation:

input in2 = {
  segmentation class all;
  syllables explicit;
  rule = 'a' -> 'b';
  resegment = true;
}

The segmentation and syllable rule specified here are applied to the input before the rule. If resegment = true; is added, segmentation is rebuilt after applying the input rule using the sound changer’s current segmentation rules, not the segmentation defined in the input.

Generators

The random replacer functions can be used to randomly generate base words to use in the sound changer using a generator.

generator gen1 = (80%)cons@(uniform) vow@(uniform) (20%)cons@(uniform);

The limitations on random replacers mentioned previously do not apply here because there is no match input, and random replacers which are not applied do not insert anything into the generated word.

Since generators are internally just replacers, replacer macros can be used in them provided they do not use any replacer elements that require bindings from a match input.

Branching

The branch directive allows storing the current state of the word being transformed, to be later recalled with the from directive:

branch b1;
rule delete_all = . -> (); // clears every word
from b1; // restores the pre-deleted state

Using Alternate Paths in tadpole CLI

To access alternate outputs from the CLI, select one either the full or csv output modes with --mode full or --mode csv. This will include all outputs in the output file. There is currently no way to isolate a single alternate output.

tadpole_cli spec.tp --infile inputs.txt --outfile outputs.txt --mode full

To use alternative inputs, the --from option with the input name can be used.

tadpole_cli spec.tp --infile inputs.txt --from in1 --outfile outputs.txt

To use a generator instead of words from an input file, replace the input file option in the command with --generate and the number of words to generate. As with inputs, the --from option selects which generator to use.

tadpole_cli spec.tp --generate 10 --from gen1 --outfile outputs.txt