Tag: sequence - adamb924/mortal-engine GitHub Wiki
A <sequence>
is like a dumb <fork> a sequence of morphemes (or other nodes) which either occur all together, or do not occur at all.
Suppose we have a language were the word begins with a verb stem. It can occur alone, or it can be followed by the “One” suffix followed by the “Two” suffix.
The example below (from examples/08-Sequences.xml) shows this kind of morphology:
<?xml version="1.0" encoding="UTF-8"?>
<morphology
xmlns="https://www.adambaker.org/mortal-engine"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://www.adambaker.org/mortal-engine morphology.xsd">
<writing-systems src="writing-systems.xml"/>
<model label="Nouns">
<stem-list label="Stem">
<filename>01-stems.xml</filename>
<matching-tag>verb</matching-tag>
</stem-list>
<sequence label="My sequence">
<optional/>
<morpheme label="First">
<allomorph>
<form lang="wk-LA">One</form>
</allomorph>
</morpheme>
<morpheme label="Second">
<allomorph>
<form lang="wk-LA">Two</form>
</allomorph>
</morpheme>
</sequence>
</model>
</morphology>
The output of the tests in examples/all-examples.xml shows the result: you can get the bare stem, or the bare stem followed by “One” and “Two”, but neither of those suffixes can occur alone.
Success: The input bil (wk-LA) was accepted by the model, which is correct. [Stem]
Success: The input bilOneTwo (wk-LA) was accepted by the model, which is correct. [Stem][First][Second]
Success: The input bilOne (wk-LA) was rejected by the model, which is correct.
Success: The input bilTwo (wk-LA) was rejected by the model, which is correct.
It is possible to have a <sequence>
without the <optional/>
tag, but that would be the same as just having the nodes there.
Any node can occur within a <sequence>
, not just <morpheme>
nodes.
In particular, you can put a <jump> tag into a <sequence>
. For instance, you could add a nominalizer morpheme, and then jump to the a node in the noun model.