EvanHahn/English-text-highlighting

Highlight names

japgolly opened this issue · 4 comments

How about highlighting names like we do with variables in code?

Examples:

  • Sherlock Holmes
  • Irene Adler
  • Atkinson
  • Holland

This would be a pretty big step up in complexity if you mean reliably recognizing arbitrary names and differentiating them from Title Case Text, initial sentence caps, adjectives made from names, etc. Did you have some other mechanism in mind?

Because this is just a demo, I think this might just take a list of strings and highlight them differently (like a reserved word in a programming language).

Thoughts?

I was going to suggest something manual along those lines, myself. This could be something like a single color for "reserved" words as you mention.

A more flexible version might be a highlight category that, if it isn't too hard to integrate, piggybacks on work others have done to generate colors that can be differentiated. If the value is a list of strings, each string gets its own color; if it's a list of lists, each list of strings gets a unique color.

In either case, there's the question of whether it's just defined in code, through some form of in-document comment/meta syntax, or a separate json/yaml config file.

If someone would like to make a pull request, I'm happy to take a look!