mbakeranalecta / sam

Semantic Authoring Markdown
Other
79 stars 8 forks source link

cancelling an attached annotation #194

Closed mbakeranalecta closed 6 years ago

mbakeranalecta commented 6 years ago

Now that we have the cancel annotation function implemented, we have to decide what the correct treatment of the following should be:

Testing {XML}(language "Hex Hem Elle") testing {XML}(language "eggs hem hell")-(language)+(language "heck's that smell?") testing {XML}.

In the second annotation of XML, we have a general annotation (which would become the lookup annotation for subsequent unannotated examples of XML as a phrase), which is immediately cancelled and then a local version of the annotation is added.

The cancel annotation means cancel any annotations added by annotation lookup, but since the phrase is annotated, there will be no annotation lookup. So we can take this cancel annotation to mean that the annotation on the phrase should be cancelled, which would make the markup equivalent to

 {XML}+(language "heck's that smell?")

But there is a twist here. What is the lookup annotation for the next XML phrase:

Testing {XML}(language "Hex Hem Elle") testing {XML}(language "eggs hem hell")-(language)+(language "heck's that smell?") testing {XML}.

Is it (language "Hex Hem Elle") or (language "eggs hem hell")? In other words, should the markup {XML}(language "eggs hem hell")-(language)+(language "heck's that smell?") say, establish this annotation as the lookup target for all subsequent instances of {XML} but locally replace it with this other markup.

Would it be clear that that is what it meant?

Is there any advantage to it meaning that? Anything you can do that way that you cannot easily do another way? It seems like a fairly obvious way to achieve the same thing would be to annotate this example like this:

 Testing {XML}(language "Hex Hem Elle") testing {XML}(language "heck's that smell?") testing {XML}(language "eggs hem hell").

This is obviously much clearer and simpler do. And if you want to avoid accidentally changing the lookup for examples down the road, either you annotate each example individually or you use local annotation for everything:

 Testing {XML}+(language "Hex Hem Elle") testing {XML}+(language "heck's that smell?") testing {XML}+(language "eggs hem hell").

Given this, I am having a hard time finding a reason to actually support:

 {XML}(language "eggs hem hell")-(language)+(language "heck's that smell?")

The alternative it to make it illegal to use a cancel annotation on any phrase with a general annotation.

The same would seem to apply to cases where it is cancelling a different annotation type:

 {XML}(standard"eggs hem hell")-(language)+(language "heck's that smell?")

Here the cancel is a no-op. There is no possibility of an language annotation that it could cancel since no annotation lookup can occur. So making this illegal has no downside that I can think of.

mbakeranalecta commented 6 years ago

Implemented restriction on attaching a cancel annotation to any phrase that has an attached general annotation in b3c3bb29c64fadad1f271d4bc34839469ba9a00d.