[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnumed-devel] Better-structured narrative output
From: |
Busser, Jim |
Subject: |
Re: [Gnumed-devel] Better-structured narrative output |
Date: |
Thu, 1 Dec 2011 21:37:40 +0000 |
On 2011-12-01, at 11:23 AM, Karsten Hilbert wrote:
> - PostgreSQL should not (and does not) play a role in
> presentation of data
No, but it might provide a built in function (or might accept the insertion /
creation of a function) that could compare two strings and resolve
for strings X, Y
where X is new and Y is old, a merge or an array of values that represent the
diffing between X and Y
start, length, string, mode
where, beginning with position 1 in string X, you would get
1, 27, X, match <--- X can only (either) match Y or inform an insertion
28, 7, X, insertion <--- this would identify an X insertion into the
original
28, 10, Y, deletion <--- Y is needed in order to identify anything that
was 'deleted'
from this, we can know that
position 38 will (at some
point in X) again match X
35, 53, X, match <--- obligate match at X 35 (28 + 7 = 35)
else the insertion must have
been longer than 7
91, 16, Y, deletion <--- Y28 + 10 (past the above deletion) identifies
at Y38
where X and Y would have again
matched and given that
they then matched for length 53
then it is at Y91 that there
is a difference which may or
may not reflect a Y-deletion
(the alternative could be X
insertion with or without Y-deletion)
> - presentation of diffs is a known-hard problem
> user interface wise
The simplest form might then be
This is the part of the string that remains the same [+ here showing a
new value or words] [- and thusly marking the part that was replaced] following
which to display the next, preserved segment of the original string [- but
showing thusly this additionally-deleted bit] followed by more that remains
true to the original [+ and supplemented by this additional insertion].
??
-- Jim
- Re: [Gnumed-devel] Better-structured narrative output, Busser, Jim, 2011/12/01
- Re: [Gnumed-devel] Better-structured narrative output, Busser, Jim, 2011/12/01
- Re: [Gnumed-devel] Better-structured narrative output, Karsten Hilbert, 2011/12/01
- Re: [Gnumed-devel] Better-structured narrative output,
Busser, Jim <=
- Re: [Gnumed-devel] Better-structured narrative output, Karsten Hilbert, 2011/12/01
- Re: [Gnumed-devel] Better-structured narrative output, Busser, Jim, 2011/12/01
- Re: [Gnumed-devel] Better-structured narrative output, Busser, Jim, 2011/12/01
- Re: [Gnumed-devel] Better-structured narrative output, Busser, Jim, 2011/12/01