cofounders / legal

Boilerplate legal templates for startups in Singapore
http://legal.cf.sg
Other
84 stars 37 forks source link

Look up definitions of special terms #11

Closed sebdeckers closed 10 years ago

sebdeckers commented 10 years ago

Legal templates define many terms and then re-use them in the same exact spelling and casing throughout the agreement. See PRIMITIVES.md.

Parse the defined terms out of the document and allow the user to view their definitions easily.

Ideas:

sebdeckers commented 10 years ago

The HTML5 spec explains how to extract the Defined Term and Definition for a <dfn/> element. http://www.w3.org/TR/html5/text-level-semantics.html#defining-term

sebdeckers commented 10 years ago

Ref: 76200332db5bfa12bb671b7b65170cb920a23862

Known Limitation

The highlighting algorithm does not repeat matched terms in the same paragraph. This is similar to how Wikipedia does not repeat linked topics in the same article. A bug in the implementation breaks this slightly. Highlighted terms in the same paragraph are repeated if the terms are separated by a longer term. This is apparent in short, frequently used terms. The solution is to be discussed: Either highlight all matches in the entire paragraph (easy change), or rewrite the matching algorithm to skip repeated terms.