add etymology entries to definitions #183
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds hidden-by-default etymology entries to each relevant definition.
3-tidy-up.js
The keys
etymology_text
andbreakdown_text
are written to eachlemmaDict
entry where etymology is provided in theparsedLine
.The
breakdown_text
is a shortened version of theetymology_text
where only the break down part is saved:Borrowed from Old Church Slavonic въплътити (vŭplŭtiti). By surface analysis, во- (vo-) + плоть (plotʹ) + -и́ть (-ítʹ).
becomesво- (vo-) + плоть (plotʹ) + -и́ть (-ítʹ)
. This extra key is handled later in4-make-yomitan.js
.I should also mention that I added this during the lemma and form JSON creation part:
I noticed while testing with a small pool of words that some leftover data was still in the
writeFolder
from a previous run, and that data was being added to my smaller dictionary. That loop should prevent that.4-make-yomitan.js
The function
getStructuredEtym
creates anextra-info
element similar to how example sentences are structured. In order for me to only seebreakdown_text
in the etymology entry, I create multiple span elements for the element's content rather than just a text node, and I add CSS in Yomitan settings to filter out only the spans I want to see.The content is handled like this:
If the entry has no
breakdown_text
, the etymology is added as a text node like usual.data\styles.css
The CSS for etymology entries are very similar to example sentence entries. The etymology entries are hidden by default.
A user can show these entries by adding this to Yomitan's custom CSS setting:
If the user wants to only see break down text like myself, they can instead add: