Tag: stems - adamb924/mortal-engine GitHub Wiki

The <stems> tag contains a list of stems for a model. This is the file referred to in <stem-list>.

The example below is adapted from examples/01-stems.xml.

<?xml version="1.0" encoding="UTF-8"?>
<stems
    xmlns="https://www.adambaker.org/mortal-engine/stems"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="https://www.adambaker.org/mortal-engine/stems stems.xsd">
    <stem>
        <form lang="wk-AR">بیل</form>
        <form lang="wk-LA">bil</form>
        <tag>verb</tag>
        <tag>front</tag>
    </stem>
    <stem>
        <form lang="wk-AR">سال</form>
        <form lang="wk-LA">sal</form>
        <tag>noun</tag>
        <tag>back</tag>
    </stem>
</stems>

This example has two stems, a verb and a noun. Each stem has forms defined for the writing systems wk-AR and wk-LA. There are also tags, indicating that the words are nouns or verbs, and front or back. These tags can be referenced later in the model.

If a stem doesn't have a form specified for a given writing system, then it's as if the stem doesn't exist for that writing system. Below, the wk-AR writing system has been omitted. This might make sense if the different writing systems correspond to different language varieties, for instance.

<stem>
    <form lang="wk-LA">sal</form>
    <tag>noun</tag>
    <tag>back</tag>
</stem>

The snippet above is actually a shorthand, equivalent to the following:

<?xml version="1.0" encoding="UTF-8"?>
<stems
    xmlns="https://www.adambaker.org/mortal-engine/stems"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="https://www.adambaker.org/mortal-engine/stems stems.xsd">
    <stem>
        <allomorph>
            <form lang="wk-AR">بیل</form>
            <form lang="wk-LA">bil</form>
            <tag>verb</tag>
            <tag>front</tag>
        </allomorph>
    </stem>
    <stem>
        <allomorph>
            <form lang="wk-AR">سال</form>
            <form lang="wk-LA">sal</form>
            <tag>noun</tag>
            <tag>back</tag>
        </allomorph>
    </stem>
</stems>

You can then specify additional allomorphs if you need to. Suppose that the language above had a distinct form for the perfect. That can be represented as follows:

<stem>
    <allomorph>
        <form lang="wk-AR">بیل</form>
        <form lang="wk-LA">bil</form>
        <tag>verb</tag>
        <tag>front</tag>
        <tag>nonperfect</tag>
    </allomorph>
    <allomorph>
        <form lang="wk-AR">ببیل</form>
        <form lang="wk-LA">bebil</form>
        <tag>verb</tag>
        <tag>front</tag>
        <tag>perfect</tag>
    </allomorph>
</stem>

As you might imagine, the “tag” approach to marking allomorphs doesn't care about what the tag means. It could refer to something phonological or to something morphological. (I remember learning about “morphosyntactically-conditioned allomorphy,” i.e., changes in morphemes attributable to morphosyntactic factors. In my own linguistic idiolect, I would just call that “morphology”. But in Mortal Engine, it's all allomorphy.)

⚠️ **GitHub.com Fallback** ⚠️