View Single Post
Old 06-24-2015, 04:32 PM   #5
Markismus
Guru
Markismus causes much rejoicingMarkismus causes much rejoicingMarkismus causes much rejoicingMarkismus causes much rejoicingMarkismus causes much rejoicingMarkismus causes much rejoicingMarkismus causes much rejoicingMarkismus causes much rejoicingMarkismus causes much rejoicingMarkismus causes much rejoicingMarkismus causes much rejoicing
 
Markismus's Avatar
 
Posts: 955
Karma: 149907
Join Date: Jul 2013
Location: Rotterdam
Device: HiSenseA5ProCC, Cracked OnyxNotePro, Note5, Kobo Glo, Aura
@didina Just looking at these two entries:
Code:
abactus <b>abactus, abacta, abactum</b><br/><font color="#457820">adj.</font> driven away/off/back; forced to resign (office); restrained by; passed (night);
abactus <b>abactus, abactus</b><br/><font color="#457820">n. m.</font> cattle thieving, stealing of cattle, rustling;
First off, I know you can convert the dictionary so that you lose the formatting like "<font color=....>" and "</font>. I'll also add the <TAB> and <EOL> explicitly. The lines become simpler:
Code:
abactus<TAB><b>abactus, abacta, abactum</b><br/>adj. driven away/off/back; forced to resign (office); restrained by; passed (night);<EOL>
abactus<TAB><b>abactus, abactus</b><br/>n. m. cattle thieving, stealing of cattle, rustling; <EOL>
Remember that sdcv only cares for the string in front of the <TAB> and the string between the <TAB> and <EOL>. All other code-like characters are hopefully not displayed in the output of sdcv.

Now two things need doing. First off: remove double entry:
Code:
abactus<TAB><b>abactus, abacta, abactum</b><br/>adj. driven away/off/back; forced to resign (office); restrained by; passed (night); b>abactus, abactus</b><br/>n. m. cattle thieving, stealing of cattle, rustling; <EOL>
Then double the lines for the multiple forms. There are three in this example:
Code:
abactus<TAB><b>abactus, abacta, abactum</b><br/>adj. driven away/off/back; forced to resign (office); restrained by; passed (night); b>abactus, abactus</b><br/>n. m. cattle thieving, stealing of cattle, rustling; <EOL>
abactum<TAB><b>abactus, abacta, abactum</b><br/>adj. driven away/off/back; forced to resign (office); restrained by; passed (night); b>abactus, abactus</b><br/>n. m. cattle thieving, stealing of cattle, rustling; <EOL>
abacta<TAB><b>abactus, abacta, abactum</b><br/>adj. driven away/off/back; forced to resign (office); restrained by; passed (night); b>abactus, abactus</b><br/>n. m. cattle thieving, stealing of cattle, rustling; <EOL>
There you go. Should be a nice scripting exercise to generate that!



I seem to remember something like:
Code:
abactus<TAB><b>abactus, abacta, abactum</b><br/>adj. driven away/off/back; forced to resign (office); restrained by; passed (night); b>abactus, abactus</b><br/>n. m. cattle thieving, stealing of cattle, rustling; <EOL>
abactum<TAB><GOTO>abactus<EOL>
abacta<TAB><GOTO>abactus<EOL>
This would have a dramatic impact on the final size of the dictionary! However, I can't remember the code that I have symbolized as <GOTO>, nor do I know for sure that this isn't just the syn-file syntax all over again.

However, as koreader is ever developping, I do know that a feature to allow to search in the dictionary popup has been requested. Don't know whether it is implemented yet. That would get rid of the need of a coded <GOTO> and you could just code:
Code:
abactus<TAB><b>abactus, abacta, abactum</b><br/>adj. driven away/off/back; forced to resign (office); restrained by; passed (night); b>abactus, abactus</b><br/>n. m. cattle thieving, stealing of cattle, rustling; <EOL>
abactum<TAB>see: abactus<EOL>
abacta<TAB>see: abactus<EOL>

Last edited by Markismus; 06-24-2015 at 04:34 PM.
Markismus is offline   Reply With Quote