Prep the SFM file: promote the subentries and add the special tag
You could prep the file manually, if there are only a few entries affected. However, it is recommended to use se2lx.pl to do it. (The documentation in the ReadMe file there at the moment is lacking some key information, but eventually these scripts will be documented there.)
Be sure you have downloaded the needed scripts from the DLS GitHub repo SubentryPromotion (the documentation in the ReadMe file there at the moment is lacking some key information, but eventually these scripts will be documented there.)
Adjust the .ini file for that script to recognize "the markers that tell you that you are no longer in a subentry".
In the .ini file, tell it what to use for the special tag for each of the complex form types.
When I ran se2lx.pl on my sample data, the command was like this:
>Perl ./se2lx-BB.pl --inifile se2lx-BB.ini --section se2lx_se MyLanguage-mod03.txt > MyLanguage-mod04-promoted.txt
I had to make sure any senses inside subentries had a different marker (e.g., \sn_SE), because normally a \sn means “you have left the subentry”. I need the senses inside the subentry to stay with it, not end it.
Also make sure all sense markers (\sn or \sn_SE or any others) have a digit in them, and they are unique, since the script will ensure that any newly created \mn fields include these sense numbers.
The result of that script (or doing it by hand) needs to be:
The subentries of senses have been extracted to be their own entry (starting with \lx not \se).
They have an \mn marker referencing the headword, any \hm in it, and the sense number they are a subentry of.
Example: \mn color2 1 refers to \hm 2 of \lx color, and the first sense.
They have a field with a special tag in them for their Complex Form Type. Example: _DERIV_ Make sure it is not a substring of the Model Tag that is in the model subentry in the empty FLEx database. (That's why I included the underscores here.)
The parent entry should not have a reference to the subentry. That is, there should not be an \se in the parent, pointing to the extracted entry.
If you had senses inside subentries (\sn_SE), change those markers back to \sn now, because that is what the import needs. For the import, all sense markers, at all levels (subsense, subentry) need to be \sn.