|
|
Re: funny typos [message #477315 is a reply to message #477310] |
Thu, 30 September 2010 02:26 |
John Watson
Messages: 8964 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
You can fix typos you know you are going to make. I often do this,
alias gerp="grep"
(of course, people who type with only one finger don't make transposition errors.)
|
|
|
|
Re: funny typos [message #477442 is a reply to message #477310] |
Thu, 30 September 2010 12:05 |
joy_division
Messages: 4963 Registered: February 2005 Location: East Coast USA
|
Senior Member |
|
|
Littlefoot wrote on Thu, 30 September 2010 02:22Another one, here:
OP: I want to create two or three sachems on my production server
MC: What are sachems? Ah! schemas...
Interesting. From where I am, there is a town called Sachem, which was named after an Indian (native American) tribe. maybe this person has developed clone technology and it wasn't necessarily a typo. However, it would surely be in the wrong forum.
As for Kevin's post, I do not think he is prejudice, but that word is not a very nice word, so I am assuming his is a typo.
|
|
|
Re: funny typos [message #477451 is a reply to message #477315] |
Thu, 30 September 2010 12:56 |
|
Barbara Boehmer
Messages: 9104 Registered: November 2002 Location: California, USA
|
Senior Member |
|
|
John Watson wrote on Thu, 30 September 2010 00:26
... of course, people who type with only one finger don't make transposition errors.
I would think that one-finger typing might reduce, but not eliminate such errors. Of course it would be slower. I do find that most of my transposition errors while touch typing with both hands are the result of one hand getting ahead of the other. There are people who are dyslexic who natural tend to transpose things, but we all have a slight such tendency from time to time. Transposition errors are so common that they have been added to algorithms that compare strings for similarity and differences. For example, there is a Damereau-Levenshtein distance formula:
http://en.wikipedia.org/wiki/Damerau%E2%80%93Levenshtein_distance
that is a modification, to include transpositions so that that each transposition is counted as one change instead of two, of the original Levenshtein distance formula:
http://en.wikipedia.org/wiki/Levenshtein_distance
Back when 8i was the most current version, I wrote a pl/sql function to implement the Levenshtein distance algorithm:
http://www.merriampark.com/ldplsql.htm
and provided it to the following site where I first found an explanation and demonstration and code in other languages:
http://www.merriampark.com/ld.htm
Now we have the Oracle supplied function utl_match.edit_distance that does the same thing, as well as some other functions in the utl_match package. But there isn't a Damerau-Levenshtein function that takes transpositions into account and counts a transposition as one change instead of two. I have received emails from people asking for such modifications. Here is a pl/sql function that I wrote for the Damerau-Levenshtein distance:
CREATE OR REPLACE FUNCTION dld -- DamerauLevenshtein distance
(str1 VARCHAR2 DEFAULT NULL,
str2 VARCHAR2 DEFAULT NULL)
RETURN NUMBER DETERMINISTIC
AS
lenStr1 NUMBER := NVL (LENGTH (str1), 0);
lenStr2 NUMBER := NVL (LENGTH (str2), 0);
TYPE mytabtype IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
TYPE myarray IS TABLE OF mytabtype INDEX BY BINARY_INTEGER;
d myarray;
cost NUMBER := 0;
BEGIN
IF str1 = str2 THEN
RETURN 0;
ELSIF lenStr1 = 0 OR lenStr2 = 0 THEN
RETURN GREATEST (lenStr1, lenStr2);
ELSIF lenStr1 = 1 AND lenStr2 = 1 AND str1 <> str2 THEN
RETURN 1;
ELSE
FOR j in 0 .. lenStr2 LOOP
d (0) (j) := j;
END LOOP;
FOR i in 1 .. lenStr1 LOOP
d (i) (0) := i;
FOR j in 1 .. lenStr2 LOOP
IF SUBSTR (str1, i, 1) = SUBSTR (str2, j, 1) THEN
cost := 0;
ELSE
cost := 1;
END IF;
d (i) (j) := LEAST (
d (i-1) (j) + 1, -- deletion
d (i) (j-1) + 1, -- insertion
d (i-1) (j-1) + cost -- substitution
);
IF i > 1 AND j > 1
AND SUBSTR (str1, i, 1) = SUBSTR (str2, j-1, 1)
AND SUBSTR (str1, i-1, 1) = SUBSTR (str2, j, 1)
THEN
d (i) (j) := LEAST (
d (i) (j),
d (i-2) (J-2) + cost -- transposition
);
END IF;
END LOOP;
END LOOP;
RETURN d (lenStr1) (lenStr2);
END IF;
END dld;
/
Here is an example that shows the difference between the utl_match.edit_distance that uses the original Levenshtein distance algorithm and the Damerau-Levenshtein distance:
SCOTT@orcl_11gR2> select utl_match.edit_distance ('grep', 'gerp')
2 as "Levenshtein",
3 dld ('grep', 'gerp')
4 as "Damereau-Levenshtein"
5 from dual
6 /
Levenshtein Damereau-Levenshtein
----------- --------------------
2 1
1 row selected.
SCOTT@orcl_11gR2>
|
|
|
Re: funny typos [message #477462 is a reply to message #477282] |
Thu, 30 September 2010 15:34 |
John Watson
Messages: 8964 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
Stuck in a lonely hotel room with nothing to look forward to except dreadful coffee for breakfast, and I get a nightcap of good and intelligent humour. This is why I love this forum. Thank you!
(though, speaking as a member of the oppressed left-handed minority, I do think that this
Littlefoot wrote on Thu, 30 September 2010 03:03they use left hand's forefinger to press the left <Shift> key
is an example of right-handed prejudice and should be reported to a moderator)
|
|
|
|
|
|
Re: funny typos [message #479579 is a reply to message #479576] |
Mon, 18 October 2010 07:22 |
CajunVarst
Messages: 55 Registered: April 2010 Location: Washington, D.C.
|
Member |
|
|
Quote:The link contains mush more on goupingtechniques
Interesting, making a typo in a typo thread....
[EDIT] Should have looked at the link first....I see is was two typos by Michel.
[Updated on: Mon, 18 October 2010 07:27] Report message to a moderator
|
|
|
|
|
|
|
|
Re: funny typos [message #482101 is a reply to message #482088] |
Tue, 09 November 2010 10:09 |
John Watson
Messages: 8964 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
In my German spell checker, the sixth suggestion was "futter". That could explain Michel's problem.
|
|
|
|
|
|
|
|
|
|
|
Re: funny typos [message #496013 is a reply to message #482250] |
Wed, 23 February 2011 13:51 |
CajunVarst
Messages: 55 Registered: April 2010 Location: Washington, D.C.
|
Member |
|
|
Quote:Barbara Boehmer
I was once typing a physical description of somebody with a supervisor watching over my shoulder. I was supposed to type "heavy set", but accidentally typed "heavy sex". The supervisor pointed out that the "t" and "x" are nowhere near one another on the keyboard.
I have one better:
when I was younger and working in retail, I was writing a request for a customer that came to the counter. I was filling in her information on the form...she said her last name was Dileo. I wrote a "d" instead of an "e". She caught it and corrected me rather quickly. After an awkward chuckle from me, she said that it actually happens quite a bit.
|
|
|
Re: funny typos [message #496017 is a reply to message #496013] |
Wed, 23 February 2011 15:12 |
joy_division
Messages: 4963 Registered: February 2005 Location: East Coast USA
|
Senior Member |
|
|
CajunVarst wrote on Wed, 23 February 2011 14:51
I have one better:
when I was younger and working in retail, I was writing a request for a customer that came to the counter. I was filling in her information on the form...she said her last name was Dileo. I wrote a "d" instead of an "e". She caught it and corrected me rather quickly. After an awkward chuckle from me, she said that it actually happens quite a bit.
I just tried writing "dileo" in script and it actually took me six times until I was able to write it correctly. I have probably never (or very rarely) ever wrote the word with the "d" in there, but it's amazing how fingers just seem to write what feels more comfortable. I don't know, maybe I was just thinking about it too much because you put the suggestion in my mind.
I so often write "ration" instead of "ratio" because "n" usually follows "io."
|
|
|
|
|
|