PHP Highlighter

Source code: https://github.com/writecrow/highlighter

Text to be highlighted:

While settling this point, she was suddenly roused by the sound of the door-bell, and her spirits were a little fluttered by the idea of its being Colonel Fitzwilliam himself, who had once before called late in the evening, and might now come to inquire particularly after her. But this idea was soon banished, and her spirits were very differently affected, when, to her utter amazement, she saw Mr. Darcy walk into the room. In an hurried manner he immediately began an inquiry after her health, imputing his visit to a wish of hearing that she were better. She answered him with cold civility. He sat down for a few moments, and then getting up, walked about the room. Elizabeth was surprised, but said not a word. After a silence of several minutes, he came towards her in an agitated manner, and thus began: "In vain I have struggled."

Highlight style
  • "Crowcordance" attempts to render full sentences on either side of the target word. If full sentences are not present, it will render what is available.
  • "Keyword in Context" attempts to render 0 words on either side of the target word.
  • "Multiple matching excerpts" attempts to highlight multiple target words, if provided, similar to a search engine result excerpt

Highlighted Excerpt

He sat down for a few moments, and then getting up, walked about the room. Elizabeth was surprised, but said not a word. After a silence of several minutes, he came towards her in an agitated manner, and thus began: "In vain I have struggled."