Spell check and validation
引入本课内容
| English | 释义 | 拼音 |
|---|---|---|
| grammar check | 语法检查 | yǔ fǎ jiǎn chá |
| proofread/ˈpruːfriːd/ | 校对 | jiào duì |
| verification/ˌverɪfɪˈkeɪʃn/ | 核对 | hé duì |
| spell check | 拼写检查 | pīn xiě jiǎn chá |
Automatic checks are not enough
- Spell checkers and validation catch many errors automatically, but neither can prove data is correct.
Spell and grammar checks 语法检查
- They miss correct words in the wrong place ("their" for "there").
- They flag correct names ("Tawara"), may suggest the wrong word, and may use the wrong dictionary ("color").
"Kowloon" is flagged and "Cartoon" suggested: ignore it. "The meeting is on there website" is not flagged, though "their" is meant.
Why can a spell checker not be fully trusted?
难度 2/5 · 今日首次完成可获 140 金币及少量额外奖励
Always proofread as well.
A spell checker will flag "there" when "their" is meant.
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
Both are correctly spelled words.
Validation
- Validation checks data is sensible and reasonable, not that it is correct.
| check | example |
|---|---|
| range | 0 to 15 |
| character | letters only in a name |
| length | exactly 11 digits |
| type | quantity is a number |
| format | LL9999 |
| presence | not empty |
Match each validation check to an example.
难度 2/5 · 今日首次完成可获 140 金币及少量额外奖励
Each checks a different property.
An age of 34 is entered instead of 43. What does validation do?
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
It is sensible, so it passes; validation cannot check correctness.
Which check stops a required email field being left empty?
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
Presence means something is entered.
Where validation stops
- A valid but wrong value passes: 34 instead of 43 is still a sensible age.
- That is why proofreading 校对 and verification 核对 are also needed.
Do not accept every suggestion. Check each one; names and technical words are often correct.
Spell checks 拼写检查 help but miss words in the wrong place and flag correct names, so proofread. Validation (range, character, length, type, format, presence) catches unreasonable data, not wrong data.
出了什么问题?只有网站团队能看到这些信息。