Ignore spaces in imput verification

Current sitiuation

I made a deck where I should guess pinyin (Latin transcription of Chinese) after the corresponding Hanzi (Chinese symbol) with input field.

The problem

As spaces doesn’t really mater in pinyin transcription and haven’t real standard rules, I could have sometimes red alert one space when it absolutely doesn’t matter at all. Like here:

In this example, “xìnglǐ” or “xìng lǐ” does not matter at all, it’s not the goal of this deck.

The question

How to tell the input verification to just ignore additional or forgotten spaces and just show them in grey color?

I don’t think that’s possible. I think it will always just do a character-by-character comparison and display red for any discrepancy.

But even if it displays red, you are still free to choose Good.

This is unrelated to your question, but I don’t pinyin can arbitrarily omit spaces. Some word boundaries are ambiguous, but most are clear. For example, you’d always have a space between tā and bù. It also seems odd to combine xìng with the last name Lǐ.

In any case, maybe you could consider a different approach: for long sentences like this, just check the meaning. And create a different set of notes where you verify the pinyin for individual words.

1 Like

Sometimes space matters. You may not distinguish “xi e” and “xie”(Though I fail to find an real example).


Something irrelevant to this topic, but has something to do with the screenshot you post.

The Hanzi “不” has two Pinyins, “bù” and “fǒu”(usually used in ancient Chinese). However, we Chinese usually pronounce “不是” as “bú shì” instead of “bù shì”.

This interesting phenomenon is called “变调”. When the next Hanzi has fourth tone(四声), we usually will change the tone of “不” to the second tone(二声). While in other cases we won’t, for example “不好” is still “bù hǎo”.

“变调” not only occurs in “不”, but also in many other circumstances. You may find more examples in the link above.

I wish you a happy learning Chinese. :smiling_face:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.