Consolidated and core issue
Using MS Access 2010 and VBA (sigh ..)
I am trying to implement a specialized Diff function that can list changes in different ways depending on what has changed. I need to create a short list of changes to submit for our records.
I would like to use something like html tags, for example <span class="references">These are references 1, 6</span> so that I can view the changes using the code and adjust how the text of the change is displayed. Or something else to complete my task.
I see this as a way to provide an extensible way to customize the output and possibly move things to a more robust platform and actually use html / css.
Does anyone know of a similar project that can point me in the right direction?
My task
I have an access database with work operations tables - usually 200-300 operations, many of which vary from one version to another. I am currently implementing a function that iterates through tables, finds instructions that have changed and compared them.
Note that each operation command is usually a pair of sentences with two lines at the end with some links to documents.
My algorithm is based on the "difference algorithm (OD) and its variations" , and it works great.
Access supports the text "Rich", which simply glorifies simple html, so I can easily generate the full text with formatted additions and deletions, i.e. add tags, for example <font color = "red"><strong><i>This text has been removed</i></strong></font> . The main conclusion of the Diff procedure is the full text of the operation, which includes immutable, deleted, and pasted text within each other. The diff procedure adds the <del> and <ins> tags, which are later replaced by formatting text later (the result is similar to the representation of changes from exchange changes in the stack).
However, as I said, I need the changes listed in a humanoid format. This has proven difficult due to the ambiguity that many changes create.
for example: If the type of chemical changes from "class A" to "class C", the text of the change that is easily generated is "Change" A "to" C ", which is not very useful for someone viewing the changes. More common are links to documents at the end: adding SOP 3 to a list, such as "SOP 1, 2, 3", generates the text "Add" 3 ". Clearly also not helpful.
What would be most useful is a custom output for text labeled “SOP”, so the output will be “Add link to SOP 3”.
I started with the following solution:
Group words together, for example. process text such as "SOP 1, 2, 3" as one token for comparison. This generates the text “Change“ SOP 1, 2 ”to“ SOP 1, 2, 3. "This is clogged when there is a large list and you are trying to determine what has actually changed.
Where am I now
Now I am trying to add additional html tags before running the diff algorithm. For example, I ran the text through a “preprocessor” that converts “SOP 1, 2” to SOP 1, 2
As soon as the Diff procedure returns the full text of the change, I look at it, marking the current "class" of text, and when there is <del> or <ins> , I commit the text between the tags and use SELECT CASE lock the class for each change.
Actually, this works fine, but there are many problems that I have to work with, for example, add Diff, deciding that the shortest way is to remove certain opening tags and insert others. This creates a script in which there are two <span> tags, but only one </span> .
Final question
I want to advise either to continue the direction I started, or to try something else before investing much more time in a non-optimal solution.
Thanks to everyone in advance.
Also note:
A typical run takes between 1.5 and 2.5 seconds when I try to use more interesting things and a bunch of debug.prints. Thus, running through an extra pass or two would not be a killer.