An example: When one is a huge fan of simple Transclusions and Transclusion templates

For convenience, code pasted at the bottom of this post for anybody who wants to experiment.

Looking for a way to automatically generate the feminine version of words when it involves simple transformation of the masculine word’s suffix, I’m sticking with my preference of using simple Transclusions with Transclusion templates :

The main tiddler with the content:

\define content()
<table>
<tr><th> Masculin / Masculine </th><td> achalant </td></tr>
<!-- 🟠🟠 Next: the Transclusion with Transclusion template-->
<tr><th> Féminin / Feminine </th><td>  {{{ [[achalant]]  || msTOfs }}} </td></tr>
</table>
\end

! Approach to deriving the female gender of male words <br> //(when it just involves only altering the ending of the word)//

!!! ''Content of this tiddler''
<pre>
<$text text={{{ [<currentTiddler>get[text]] }}}/>
</pre>

!!! ''Content of {{msTOfs!!title}} tiddler''
<pre>
<$text text={{{ [[msTOfs]get[text]] }}}/>
</pre>

!!! Result
<<content>>

The content of the template tiddler:

<$text text={{{ [<currentTiddler>split[]last[3]join[]match[ant]then<currentTiddler>addsuffix[e]] }}} />
5 Likes

Based on the experimental code shared earlier, I’m now slowly putting together the general rules for building the feminine form of masculine words.

The template tiddler (ms2fs, abbreviation for "masculine singular to feminine singular) now looks like this:

(Note the dynamically generated filter for the list widget)

\define ruleSuffix(l sm sf)
[<mot>split[]last[$l$]join[]match[$sm$]then<mot>split[]butlast[$l$]join[]addsuffix[$sf$]]
\end

<$let mot={{!!title}}
        fallbackSuffix="[<mot>addsuffix[e]] +[first[]]">
<$list filter={{{ [<ruleSuffix 2 el elle>]
                         [<ruleSuffix 2 en enne>]
                         [<ruleSuffix 2 an anne>]
                         [<ruleSuffix 2 on onne>]
                         [<ruleSuffix 4 aire airesse>]
                         [<ruleSuffix 4 ince incesse>]
                         [<ruleSuffix 5 cteur ctrice>]
                         [<ruleSuffix 2 bé besse>]
                         [<ruleSuffix 3 eur euse>]
                         [<ruleSuffix 1 e e>]
                         [<fallbackSuffix>] +[join[ ]] }}} >
{{!!title}}
</$list>

For testing purposes, my test tiddler has the following code:

\define content(m)
<table>
<tr><th> Masculin / Masculine </th><td> un $m$ </td></tr>
<tr><th> Féminin / Feminine </th><td>  une {{{ [[$m$]]  || ms2fs }}} </td></tr>
</table>
\end

[[La formation du féminin des noms|https://web.unica.it/unica/protected/409843/0/def/ref/MAT407472/#:~:text=A)%20R%C3%A8gle%20g%C3%A9n%C3%A9rale%20%3A%20pour%20former,(e)%20au%20nom%20masculin.]]

<<content arbitre>>
<<content élève>>
<<content prince>>
<<content maire>>
<<content champion>>
<<content paysan>>
<<content chien>>
<<content criminel>>

And the results:

4 Likes

An incremental/iterative simplification of that tiddler template:

\define ruleSuffix(sm sf)
[<mot>removesuffix[$sm$]addsuffix[$sf$]]
\end

<$let mot={{!!title}}
        default="[<mot>addsuffix[e]] +[first[]]">
<$list filter={{{ [<ruleSuffix el elle>]
                         [<ruleSuffix en enne>]
                         [<ruleSuffix an anne>]
                         [<ruleSuffix on onne>]
                         [<ruleSuffix aire airesse>]
                         [<ruleSuffix ince incesse>]
                         [<ruleSuffix cteur ctrice>]
                         [<ruleSuffix bé besse>]
                         [<ruleSuffix eur euse>]
                         [<ruleSuffix e e>]
                         [<default>] +[join[ ]] }}} >
{{!!title}}
</$list>
4 Likes