Sunday, April 16, 2006

Really useful spelling checkers

How would you write a Welsh spelling checker? Would you check to make sure that the word has no vowels (see later for a practical example of a use for a vowel eliminator) or that it is completely unpronounceable, or that it looks weird.

Back to the point of the story. I was working on the presentation on which this blog is based, with a colleague and he was using Mapper to do some of the clever multimedia bits. Now Mapper is a non­procedural parameter based 4GL but it looks awful, let us take a look at some code;

@incv6ifv6<7gtolin-2;.

@if v36 = " Idv v36=0 ; if v37 = " gto lin 3 . truncate before stacking @cal,-4 AV 15-10,26-10,37-10,48-10,59-10,70-10 ,a,a,a,a,a,a 1 a=(v37a)*(v36)+(v36<=a)*(v37>=a)*a rnm -4. @cal,-4 AO 15-10,26-10,37-10,48-10,59-10,70-10 ,a,b,c,d,e,f 1 'm=vmin(a,b,c,d,e,f);n=vmax(a,b,c,d,e,f);m=vmin(a,m);n=vmax(a,n);'1 I 'a=a+b+c+d+e+f;n=vmax(a,n)' v20f12,v21f12 .

@if v37 = " Idv v37=v21 ; if v37 < v21 Idv v37=v21 ; if v36 = " Idv v36=v20 @rsr,v97,v98,v114 1 . v25 = interval, v26 = number of int, v28 = scale factor, @rsr 91 . subroutine to draw grid lines, tics, y-axis labels
@cal,-4 Ar.00000001 15-10,26-10,37-10,48-10,59-10,70-10 ,a,a,a,a,a,a 1
a=a rnm -4.',
@cal,-4AIV 15-10,25-10,37-10,48-10,59-10,70-10 ,a,b,c,d,e,f 1 a=a*v28;a=a-(v36*v28);b=a+(b*v28);c=b+(c*v28);d=c+(d*v28);e=d+(e*v28);1 i f=e+(f"v28).
@Idv v3i3=1,v4i3=1 . v4 wiLL be number of bars to draw + 1 @if v89(v3-1) = 1 inc v4 ; inc v3 if v3 < 7 gto lin-0 . @ifv4=7decv4;.
@art v179+1;1.225*a;242501b;c*1.225 v118i5,v12f12,v25i5,v26i5 .

Pretty bad, eh! On the other hand did have a song written about it. It was at this point that an amazing thought dawned on me -- all the best programmers I knew spoke languages that could best be described as 'self encrypting'.

1 Comments:

Anonymous Anonymous said...

Just came across your blog. The name caught my interest since it is taken from my favorite book - Zen and the art of motorcycle maintenance by Robert M Pirsig...it's also in the same area as my own blog. Great posts...

12:14 PM  

Post a Comment

<< Home

Technology
Blog Top Sites Weblogs Directory SynBlog.com - Blog Directory View Terence Thorpe's profile on LinkedIn