gnumed-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnumed-devel] Better-structured narrative output


From: Karsten Hilbert
Subject: Re: [Gnumed-devel] Better-structured narrative output
Date: Thu, 1 Dec 2011 22:46:41 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Dec 01, 2011 at 09:37:40PM +0000, Jim Busser 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 

Oh, OK. Now that's technically possible to do in PostgreSQL,
yes (but would need to be written).

However, the rules for determining start/length/string/mode
are fully arbitrary and entirely depend on the goal.

> 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)

What about ambiguity ?  (the simplest form of which would be
two potentially detected changes according to the above
rules would overlap)

Karsten
-- 
GPG key ID E4071346 @ gpg-keyserver.de
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346



reply via email to

[Prev in Thread] Current Thread [Next in Thread]