As of my last post, everything done to that point was much like piling on clay to get a general idea of what all I need.
I’ve been refining this hunk of clay, focusing first on these fundamental things:
- editing and viewing the type(s) for the word (noun, verb, etc.), keeping in mind that a word could have more than one type (for example: a word could be both a noun and an adjective)
- editing and viewing the gender and number of a word (Todo: hide these when gender and number do not apply)
Words that are masculine and have no feminine form, the TW has the basic underpinnings to auto-generate the pluralized version of the word. Same for words that are feminine and have to masculine form.
Words that are masculine and have a feminine form, the TW has the basic underpinnings to auto-generate the feminine-singular version of the word, and the smarts to pluralize both the masculine and auto-generated feminine-singular version of the word.
Some masculine words that have a feminine form, the feminine form is not easily auto-generated and/or needs to independently exist as a tiddler for some very specific information for the feminine word (like phonetic attributes, or other uniquely important info). In this case, the masculine and feminine words are linked via a word ensemble (or word “casting” … I’m on the fence.) In this situation, the masculine and feminine words are known, and those existing words are each pluralized.
Here are some examples:
A masculine word that has no feminine form:
A word that is both masculine and feminine:
A feminine word that has no masculine form:
Here’s a masculine word that has been marked as having a feminine form, and that feminine form is auto-generated. Eventually, I will be setting up the feminine word as a dedicated tiddler because I want to add some details specific to that feminine word:
And finally a masculine word that has a feminine form, and the feminine form of the word exists as a tiddler. The masculine and feminine versions of the word are linked via an ensemble/casting.
Here’s what that last one looks like when in “EDIT” mode:
(ignore the stuff in the top-left block under the word “darnier” and above the “Visualiser” button … that’s stuff I need to refactor.)
In case you like to dissect code, here’s how the “Word Types” the “Gender and Number” sections are put together:
<table>
<tr><td class="tdh right" style="white-space:nowrap;">Type(s) de mot / Word Type(s):</td><td class="left" style="width:100%;">{{{ [<wordTiddler>] || tWT }}}</td></tr>
<tr><td class="tdh right">Genre et nombre / Gender and Number:</td><td class="left" style="width:auto;">{{{ [<wordTiddler>] || tMGN }}}</td></tr>
</table>
So both sections are put together by transcluding the word “darnier” with Transclusion templates. tWT is a tiddler that has all of the goods for the “Word Type” info. tMGN is a tiddler that has all of the goods for the “Gender and Number” info.
The tWT tiddler:
<$list filter="[{!!title}tags[]tag[WT]sort[]]">
<span style="white-space:nowrap;">{{{ [{!!df}] [{!!de}] +[join[ / ]] +[addprefix[✔ ]] || txt }}} </span>
</$list>
<$list filter="[{!!title}tags[]tag[WT]else[NONE]match[NONE]]">
//Aucun choisi / None selected//
</$list>
<$list variable="c" filter="[<formMode>match[EDIT]]">
<details open><summary>EDIT {{!!title}}</summary>
<<colList "wt" "[tag[WT]]" 25 "<$checkbox tag=<<wt>>> {{{ [<wt>get[df]] || txt }}} / {{{ [<wt>get[de]] || txt }}}</$checkbox>">>
</details>
</$list>
The tMGN tiddler:
\define ms2fs() {{!!title || tMS2FS }}
\define ms2fp() <$wikify name="mot" text=<<ms2fs>>>{{{ [<mot>split[]butlast[]join[]] || tS2P }}}</$wikify>
\define gFilter(g) [{!!title}get[g]match[$g$]]
\define gLine(t,s,p)
<tr><td class="tdh right">$t$:</td> <td>$s$</td> <td>$p$</td></tr>
\end
<$let we={{{ [{!!title}tagging[]tag[gn]nth[1]] }}}>
<!-- 🟠🟠🟠 VIEW mode -->
<table>
<tr><td class="tdtl"></td><td class="tdh">__Singulier / Singular__</td><td class="tdh">__Pluriel / Plural__</td></tr>
<$list variable="g" filter={{{ [<gFilter mf>] }}}>
<<gLine "Masculin et féminin / Masculine and Feminine" "{{!!title}}" "{{!!title || tS2P }}" >>
</$list>
<$list variable="g" filter={{{ [<we>is[blank]then<gFilter f>] }}}>
<<gLine "Féminin / Feminine" "{{!!title}}" "{{!!title || tS2P }}" >>
</$list>
<$list variable="g" filter={{{ [<we>is[blank]then<gFilter m>] }}}>
<<gLine "Masculin / Masculine" "{{!!title}}" "{{!!title || tS2P }}" >>
<$list variable="c" filter="[{!!title}get[tf]match[y]]">
<<gLine "Féminin / Feminine" "<<ms2fs>>" "<<ms2fp>>" >>
</$list>
</$list>
<$list variable="g" filter={{{ [<we>!is[blank]] }}}>
<<gLine "Masculin / Masculine" "{{{ [<we>tags[]tag[mot]g[m]] || txt }}}" "{{{ [<we>tags[]tag[mot]g[m]] || tS2P }}}" >>
<<gLine "Féminin / Feminine" "{{{ [<we>tags[]tag[mot]g[f]] || txt }}}" "{{{ [<we>tags[]tag[mot]g[f]] || tS2P }}}" >>
</$list>
</table>
<!-- 🟠🟠🟠 EDIT mode -->
<$list variable="check" filter="[<formMode>match[EDIT]]">
<details open><summary> EDIT {{!!title}} </summary>
<!-- 🟠 --> ''genre / gender'':
<$select tiddler=<<currentTiddler>> field="g">
<option value="m">Masculin / Masculine</option>
<option value="f">Féminin / Feminine</option>
<option value="mf">Les deux / Both</option>
<option value="">Aucun / None</option>
</$select><br>
<$list variable="c" filter="[<wordTiddler>get[g]match[m]]"><$checkbox tiddler=<<wordTiddler>> field="tf" checked="y" unchecked=""> Se transforme à une variante féminine / Transforms itself to a feminine variant</$checkbox><br></$list>
<!-- 🟠 --> ''nombre / number'':
<$select tiddler=<<currentTiddler>> field="sp">
<option value="s">Singulier / Singular</option>
<option value="p">Pluriel / Plural</option>
<option value="sp">Les deux / Both</option>
<option value="">Aucun / None</option>
</$select>
<!-- 🟠 word ensemble -->
<details open><summary>Casting</summary>
<<weCreate gn>>
<<weAddWord gn>>
</details>
</details>
</$list>
<!-- ⚫ -->
</$let>