jdlorimer/chinese-support-redux

capital letters in syllables in reading field (imported previously) are not recognized as real chinese syllables and shown as tone 5 letters.

Opened this issue · 8 comments

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Specs (please complete the following information):

  • OS: [e.g. Windows, iOS, Ubuntu]
  • Anki Version [e.g. v2.0.52, v2.1.5]
  • Chinese Support Version [e.g. v0.5.3-beta]

Additional context
Add any other context about the problem here.

If you can give an example, I'll take a look at it.

Example (from txt files which I use to import cards):
凯文 Kai3wen2 Kevin (person name)

(I added spaces only to visually render the 3 fields)
The second field is the reading field, the one that when has capital letters is rendered with "tone5" syllables:
Kǎiwén

changing PINYIN_INITIALS to 'zh|Zh|sh|Sh|ch|Ch|chu|Chu|[bpmfdtnlgkhjqxrzscwyBPMFDTNLGKHJQXRZSCWY]' should fix this

What do you mean?
Changing one by one all initials? That is what I have already been doing, but of course is time consuming
Or maybe what you've written is some sort of code that will do it automatically? (in the latter case I don't know how to implement it)

@rudyeikichi if you need to fix it quickly, edit the file consts.py in the add-on folder and replace the line

PINYIN_INITIALS = 'zh|sh|ch|chu|[bpmfdtnlgkhjqxrzscwy]'

with

PINYIN_INITIALS = 'zh|Zh|sh|Sh|ch|Ch|chu|Chu|[bpmfdtnlgkhjqxrzscwyBPMFDTNLGKHJQXRZSCWY]'

Thank you! I didn't know this coding trick! Now it works perfectly! thank you very much

@rudyeikichi can you keep issue open because it is still an issue with the add-on? Looks like @luoliyan may be inactive and it is time for fork-of-a-fork (I am happy to maintain)

Ok. Keep open. Anyway it still doesn't work with all letters. I input some words that start with the hanzi of Australia and it gave me A with tone 5, and "o" with the correct tone. I added the letter A to the list of initials in that file but still not working. Anyway not big problem, if I have to change just the words starting with a capital A, it's still much better than change all capital letters by hand. If I see other letters that don't work properly I'll write them down here. Anyway for I'm really happy with this correction of the initials.