Syllables
To simplify working with stress and similar things, tadpole supports segmenting inputs into syllables.
Defining Syllable Structures
The simplest method of defining syllables is to do so explicitly in your inputs. To do so, you can use . to signify syllable breaks in the input and use
syllables explicit;However, tadpole can also automatically determine syllable boundaries by using matchers.
syllables match cons? vow cons?;This will enable syllable segmentation and set up a basic (C)V(C) syllable structure. To determine syllable boundaries, tadpole will step through the input and find matches for the given matcher, using the earliest boundary that can produce a full segmentation.
To be more restrictive for valid syllables, it’s possible to list multiple valid syllable structures in the second variant of the syllable definition:
syllables {
match vow;
match cons vow;
match cons vow cons;
}Unlike the previous example, this will never create any VC syllables.
In this form of the syllable definition, it is also possible to specify a bias parameter.
syllables {
match cons? vow cons?;
bias = 100;
}This is a number between 0 and 100 which changes where tadpole prefers to separate syllables. The default 0 tries to end syllables as early as possible. Setting it to 100 will end syllables as late as possible. Values in between sort all available boundaries and choose the one closest to the n% mark of the list for a bias of n.
Like with symbol segmentation, syllable segmentation can be reset using:
syllables clear;Structured Syllables
There are two special matcher operators, :> and <:, which allow splitting the syllable structure matchers into maximizing and minimizing sections. The syllable segmenter will try to minimize elements to the right of :> (coda) and to the left of <: (reluctant onset). Each may be used at most once in each syllable structure, and :> must always be to the right of <: if both are used.
syllables match cons? <: cons? vow{1-2} :> cons? cons?;This will split consonants between syllables as follows:
- VV
- V.CV
- VC.CV
- VCC.CV
- VCC.CCV
When using the syllable structure operators in any syllable structure within a syllable segmenter specification, the default bias value is 100 to maximize syllables with no coda. Syllable structure operators should be applied either to none or all applicable syllable structures. They can be safely omitted in syllables with no coda or reluctant onset.
Syllable Features
Syllables can also have features assigned which apply to the entire syllable. Syllable features are defined much like features but with the syllables keyword added in front:
syllables feature stress = +stress -stress default -stress;
syllables feature openness = open closed;Syllable features can be applied in two ways.
Syllable Structure Features
Using the second, extended syntax for syllable matching also allows specifying features which will apply to all syllables created with the given matcher.
syllables {
match cons vow = [[open]];
match cons vow cons = [[closed]];
}Note that syllable features are written in double brackets here.
Syllable Modifiers
There is an additional type of modifier omitted in the previous chapter, syllable modifiers.
modifier (syl) '\u{02c8}' /* IPA stress mark */ = [+stress];Note that as an exception, syllable features are written in single brackets for ease of parsing.
Keeping Syllables Valid
Tadpole does not automatically update syllable structure when rules insert or remove symbols. To ensure syllables are valid, you may need to regenerate the syllable information after some rules.
syllables rebuild;When rebuilding syllables, syllable modifiers are detached from the symbol string and then re-attached to the best-matching new syllable. This allows significant changes in syllable structure to occur between rules, but may not always yield the desired result and may need assistance from the rule structure itself.
To simplify keeping syllables up to date, it can be useful to define a hook:
hooks pre = {
syllables rebuild;
}This will rebuild syllables before each rule is run, ensuring that syllable information is always valid. Hooks will be discussed in more detail in a later chapter.
Matching and Replacing Syllables
Plain Syllable Matcher
To match any entire syllable, you can use the syl matcher.
rule delete_last_syl = syl -> () in _ #;This example will delete the last syllable each input.
Syllable Boundary Matcher
The matcher ^ matches syllable boundaries as well as word boundaries.
rule stretch_short_syl = .@s -> <s> <s> in ^ _ ^;This example will duplicate any symbol which is a syllable on its own.
Syllable Feature Matcher
Feature matrices with double brackets match syllables according to their syllable features.
rule delete_unstressed_final = [[-stress]] -> in _ #;This will delete any unstressed syllables at the end of the word.
Syllable Bindings
Both the syl matcher and syllable feature matrices produce syllable bindings, which function as content bindings.
rule reduplicate_last = syl@s -> <s> <s> in _ #;This will reduplicate the last syllable in the word.
Syllable feature matrices can also be used with syllable bindings as replacers, similarly to symbol bindings with regular feature matrices. This will also attempt to add modifiers, but cannot change syllable structure inherent features.
Matching Symbols with Syllable Features
To match a symbol inside a syllable with a specific syllable feature, the best approach is usually to match and narrow the syllable feature:
rule in_stressed = [[+stress]] >> (vow)@s -> [+long]@s;