Keyword Highlighting: Chinese Has No Word Boundaries

Open Tool Keyword Highlighter

Highlighting marks text for the eye

Highlighting adds background or markers to matched keywords for review, comparison and teaching. Adding terms one at a time, matching each occurrence and stacking are the basics, with case sensitivity and whole-word matching controlling scope. Whole-word matching relies on word boundaries, which English gets from spaces and punctuation while Chinese has none, making the toggle nearly useless there. HTML export carries styling; plain-text copy leaves only words. It suits visual marking of a few terms, not full-text search.

Steps

  1. Paste the text, escaping angle brackets and ampersands first.
  2. Type a term and press Enter to add each one.
  3. Enable case and whole-word matching for English; case alone barely matters for Chinese.
  4. Preview to see hits, where overlapping terms stack in order.
  5. Copy plain text to keep words, or export HTML to keep styling.
  6. Clear for the next document.

Escaping, overlap, export

Content containing angle brackets or ampersands must be escaped before highlighting, or the exported HTML breaks and pages render wrong, with security risk attached. Overlap needs care: when one term contains another, handling only long or only short terms misses the other, and tools follow insertion order, so order terms deliberately. HTML export needs inline styling, since external stylesheets do not travel. Plain-text copy drops every mark, which is the point. Case sensitivity separates proper nouns from common words in English and means nothing in Chinese.

Common mistakes

Unescaped content scrambling the exported HTML. Whole-word matching on Chinese, expected to improve accuracy and changing nothing. Overlapping terms highlighted only in part. Exports depending on external styles and losing colour elsewhere. Plain-text copy mistaken for a loss of highlighting. And case sensitivity causing missed English hits.

Where highlighting stops

Counting hits needs a search tool, with highlighting as presentation. Exporting for a public page requires trusting the content rather than rendering raw input. Large annotation jobs work better with people and tools together. Text carrying sensitive data should not leave after highlighting, since colour is not masking. And treating highlights as a search result misses every synonym.

⏫︎