vonpetersenn / Pleco-to-Anki

An AddOn for the flashcard App to import bookmark files from the chinese dictionary app Pleco.
The Unlicense
6 stars 2 forks source link

English section formatting bugs #12

Open ethanxrosen opened 2 hours ago

ethanxrosen commented 2 hours ago

Reporting a few formatting bugs I noticed- thank you again for the help in already addressing the other few this month!

  1. extra line breaks are sometimes added to translations, seems to happen often with [square brackets] or characters with periods like "v."

example: 着zhe, expected formatting

auxiliary [added to a v. or SV to indicate a continued action or state, often with the particle 呢 at the end of the sentence] qǐng nǐ zài wàitou děng jǐ fēnzhōng ba. They are talking just now, please wait outside a few minutes. [in sentences beginning with a place word, added to the v. to indicate a resultant state, the v. plus 着 having the force of “there is”] [verb plus 着 placed before another verb, indicating an accompanying action or state] a [verb plus 着 serving as an adverbial modifier] jí zhe yào chūqu wánr. b [verb plus 着 repeated, indicating that while one action is in progress another is expected] [in imperative sentences, used after verbs or adjectives for emphasis, often with 点儿 added] [in forming a preposition]

actual formatting (also some issues handling 4a. and 4b. definitions for this character)

auxiliary [added to a v. or SV to indicate a continued action or state, often with the particle 呢 at the end of the sentence] qǐng nǐ zài wàitou děng jǐ fēnzhōng ba. They are talking just now, please wait outside a few minutes. [in sentences beginning with a place word, added to the v. to indicate a resultant state, the v. plus 着 having the force of “there is”] [verb plus 着 placed before another verb, indicating an accompanying action or state] a [verb plus 着 serving as an adverbial modifier] jí zhe yào chūqu wánr. The children are in a hurry to go outside and play. 着 repeated, indicating that while one action is in progress another is expected] [in imperative sentences, used after verbs or adjectives for emphasis, often with 点儿 added] [in forming a preposition]

  1. translations for characters with "opp." are cut short

ex 优点

expected translation including opposite word

n. merit; strong (or good) point; advantage; virtue (opp. 缺点)

actual translation

n. merit; strong (or good) point; advantage; virtue (opp.

vonpetersenn commented 2 hours ago

Thank you for bringing these issues to my attention! Regarding the extra line breaks: Since I don't know the true underlying formatting used in creating the Pleco app, this AddOn will never produce perfectly formatted notes every time. The best I can do is to develop a set of rules for reformatting the incoming notes. One of these rules is to add a line break whenever there's a period. This can sometimes lead to undesired line breaks mid-sentence, such as with abbreviations like "v.". While I could potentially add exceptions for common cases like "v.", I generally aim to keep the number of edge cases this AddOn handles to a minimum.

My philosophy for creating Anki cards is to only keep the information I want to learn. As a result, I often end up deleting many of the sentences the AddOn produces and reviewing each note anyway. For me, the AddOn allows me to start with a "good enough" note that I can then refine to meet my needs, saving a significant amount of time compared to writing down all information manually.

Regarding the truncation issue with "opp.": This seems to be causing a loss of information from the original Pleco note, which is a more serious problem. If I find the time, I will prioritize fixing this issue.

My goal with this AddOn is to provide a helpful starting point for note creation, recognizing that users may need to make some adjustments based on their specific needs. So I am not sure if I will spend more time myself changing the code to adress formatting issues, as there will always be formatting issues until I have identified the complete set of formatting rules underlying the Pleco app's database. If you notice any other issues or have suggestions, please don't hesitate to let me know.