As discussed on the last legal call, here’s my proposal for enhancing the markup.
There are two problems that need solving:
Maintaining a version of the licenses with just enough markup to aid in the computer-hard decisions
Make computer matching entirely logic-free by providing the required information to an implementation with markup
Since (2) may necessarily be difficult to maintain by hand, as well as be error-prone (for example, finding *every* synonym instance in some license text), I suggest that a build process is necessary to produce the "enhanced" [item (2)] markup from the human-maintained "source" markup.
Items that belong in the source markup are items that are easy for a human to identify but difficult for a program to identify (or easy for multiple implementations to get "differently"). These items include:
Headers (copyright declaration, license name preface)
Bullets (specifically in the case of numbered bullets with roman numerals, it can be difficult to distinguish accurately from wrapped text ending a sentence)
Optional sections (such as instructions on license application)
References to the author / copyright holder
Items that belong in the enhanced markup are items that are easy for a program to identify, where the build process can create a canonical "correct" form of the text to-match, thus 1) obviating implementations from the need to write boilerplate parsing code and 2) ensuring that implementations produce the same results given the same sample text. These include:
Varietal spellings
Copyright symbol
Punctuation (dashes and quotes)
Whitespace
Capitalization
The whitespace and capitalization items are somewhat questionable, but since there is already a build process it doesn’t hurt us to add them, and it means that implementations will not have a need to perform any transformations on the matching-text beyond XML parsing. An important note: whitespace between words being significant, this approach will not necessarily lead to the desired results if we encounter a need or desire to create *optional* sections of text. For example, James, while John had hadhad had a better effect on the teacher – in this example sentence, if zero matches occur, we will be matching a sentence with two spaces in a row. I don’t believe this will currently be a problem, because I don’t know of any reason for us to mark up templates in this way; every matchable component should encompass the left and right word boundaries, so spacing should not be an issue and should be preserved exactly as produced in the enhanced markup.
Please correct me if I am mistaken – I appear to be unable to find documentation on the current markup – but I observe two elements in the current markup syntax: 1) entity replacement and 2) optional section blocks. These are quite readily translated into an XML form. I am uncertain if the variable function is used by any of the current tooling, but it can be left off until desired or added as-is.
Suggested transformations:
<<var; name=foo; original=Original Text; match=.+>>
becomes: Original Text
<<beginOptional; name=optionalIntro>>Some text here<>
becomes:
Some text here
This is a fairly direct translation and could even be performed programmatically on the existing data if we elect to use a generic "optional" tag; above I’ve used "section" as a placeholder for multiple candidate tags depending on the section being described.
While we can define all desired elements in terms of "alt" tags, I believe some of them at least deserve their own tags. Bullets, for example, I would suggest wrapping in "\<b>"; this is primarily for brevity:
`1. Some clause …2. More items….a. Sub-item…`
The need for brevity comes as a result of trying to keep the source markup as human-manageable as possible. While it’s somewhat tempting to designate hierarchical \<ol> or \<ul> items as in HTML, this doesn’t actually provide any use for *matching* purposes, so has been explicitly discarded.
Other items that might warrant their own tags actually become section wrappers, such as for copyright declarations: