Auto correction of typos

--000e0cd32c168d251c049db6b913
Content-Type: text/plain; charset=ISO-8859-1

I have a web form where people sign up for updates by filling in their email
address

A lot of users end up not receiving the confirmation mailer because of typos
in the email id
Like yhaoo.com or hotmaill.com

I would like to prompt the user for a possible typo , like the google "Did
you mean this ? "
What is the best module I can use for suggestion





--
Thanks
Ram
<http://www.netcore.co.in/>




n <http://pragatee.com>

--000e0cd32c168d251c049db6b913--
Ramprasad Prasad [ Sa, 05 März 2011 07:53 ] [ ID #2056226 ]

Re: Auto correction of typos

Hi Ramprasad,

On Saturday 05 Mar 2011 08:53:49 Ramprasad Prasad wrote:
> I have a web form where people sign up for updates by filling in their
> email address
>
> A lot of users end up not receiving the confirmation mailer because of
> typos in the email id
> Like yhaoo.com or hotmaill.com
>
> I would like to prompt the user for a possible typo , like the google "Did
> you mean this ? "
> What is the best module I can use for suggestion

Well, you can try doing a DNS lookup but naturally, it's possible some people
have registered an MX address for "yhaoo.com" or "hotmaill.com", due to
phishing or as a parody, or because of a different reason. If you want to find
out if an email address exists in the remote host, I think you'll need to
initiate an SMTP connection.

Note that I suggest you allow the user to login again and to later on change
the password. Moreover, many modern browsers, will auto-fill a field based on
the name="...." attribute so you should set it to name="email".

Regards,

Shlomi Fish

--
------------------------------------------------------------ -----
Shlomi Fish http://www.shlomifish.org/
Stop Using MSIE - http://www.shlomifish.org/no-ie/

Nobody expects the Randal Schwartz condition!
-- David Fetter

Please reply to list if it's a mailing list post - http://shlom.in/reply .

--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
Shlomi Fish [ Sa, 05 März 2011 09:39 ] [ ID #2056227 ]

Fwd: Re: Auto correction of typos

Ramprasad sent me this message in private by accident. sending to the list.

===> Shlomi Fish

---------- Forwarded Message ----------

Subject: Re: Auto correction of typos
Date: Saturday 05 Mar 2011, 13:25:48
From: Ramprasad Prasad <ramprasad.ap [at] gmail.com>
To: Shlomi Fish <shlomif [at] iglu.org.il>

On Sat, Mar 5, 2011 at 2:09 PM, Shlomi Fish <shlomif [at] iglu.org.il> wrote:

> Hi Ramprasad,
>
> On Saturday 05 Mar 2011 08:53:49 Ramprasad Prasad wrote:
> > I have a web form where people sign up for updates by filling in their
> > email address
> >
> > A lot of users end up not receiving the confirmation mailer because of
> > typos in the email id
> > Like yhaoo.com or hotmaill.com
> >
> > I would like to prompt the user for a possible typo , like the google
> "Did
> > you mean this ? "
> > What is the best module I can use for suggestion
>
> Well, you can try doing a DNS lookup but naturally, it's possible some
> people
> have registered an MX address for "yhaoo.com" or "hotmaill.com", due to
> phishing or as a parody, or because of a different reason. If you want to
> find
> out if an email address exists in the remote host, I think you'll need to
> initiate an SMTP connection.
>
>
I dont want to send mails to a domain like say yaahoo.com even if it had a
valid MX.
Because may be a parked or spamtrap domain

What I wanted to do was create a list of possible typos by people on the
large mail domains like yahoo , hotmail etc







> Note that I suggest you allow the user to login again and to later on
> change
> the password. Moreover, many modern browsers, will auto-fill a field based
> on
> the name="...." attribute so you should set it to name="email".
>
> Regards,
>
> Shlomi Fish
>
> --
> ------------------------------------------------------------ -----
> Shlomi Fish http://www.shlomifish.org/
> Stop Using MSIE - http://www.shlomifish.org/no-ie/
>
> Nobody expects the Randal Schwartz condition!
> -- David Fetter
>
> Please reply to list if it's a mailing list post - http://shlom.in/reply .
>



--
Thanks
Ram
<http://www.netcore.co.in/>




n <http://pragatee.com>

-----------------------------------------
--
------------------------------------------------------------ -----
Shlomi Fish http://www.shlomifish.org/
My Public Domain Photos - http://www.flickr.com/photos/shlomif/

"I simply hate, detest, loathe, despise, and abhor redundancy."
-- http://uncyclopedia.org/wiki/Redundancy

Please reply to list if it's a mailing list post - http://shlom.in/reply .

--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
Shlomi Fish [ Sa, 05 März 2011 12:33 ] [ ID #2056229 ]

Re: Fwd: Re: Auto correction of typos

On Sat, Mar 05, 2011 at 01:33:02PM +0200, Shlomi Fish wrote:

> Ramprasad sent me this message in private by accident. sending to the list.

> What I wanted to do was create a list of possible typos by people on the
> large mail domains like yahoo , hotmail etc

Perhaps you want something like Text::Levenshtein on CPAN?

--
Paul Johnson - paul [at] pjcj.net
http://www.pjcj.net

--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
Paul Johnson [ Sa, 05 März 2011 13:26 ] [ ID #2056230 ]

Re: Auto correction of typos

Sat, 5 Mar 2011 12:23:49 +0530 письмо от Ramprasad Prasad <ramprasad.ap [at] gmail.com>:

> I have a web form where people sign up for updates by filling in their email
> address
>
> A lot of users end up not receiving the confirmation mailer because of typos
> in the email id
> Like yhaoo.com or hotmaill.com
>

MaxMind has a module Email::IsFree though I'm not sure if it's helpful to you.

http://search.cpan.org/~tjmather/Email-IsFree-0.02/IsFree.pm

--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
terry peng [ So, 06 März 2011 09:30 ] [ ID #2056240 ]

Re: Auto correction of typos

--002215975af2c3207e049dd17cee
Content-Type: text/plain; charset=ISO-8859-1

On Mar 5, 2011 1:54 AM, "Ramprasad Prasad" <ramprasad.ap [at] gmail.com> wrote:
>
> I have a web form where people sign up for updates by filling in their
email
> address
>
> A lot of users end up not receiving the confirmation mailer because of
typos
> in the email id
> Like yhaoo.com or hotmaill.com
>
> I would like to prompt the user for a possible typo , like the google "Did
> you mean this ? "
> What is the best module I can use for suggestion
>
>
I think you have two decent options here. The technical - name the fields
sensibly (ie, 'email') and hope for a browser side auto generate / auto
correct.

Psychological - step back and think about how you fill out forms and when
you've been able to notice and fix errors. I generally hit ctrl+a ctrl+c
after filling out an email field, so if I typo'd, that little confirm isn't
going to do anything. Now, one idea might be an ajax'y capcha with the email
address at the very bottom. I hate capchas but I'd probably be able to pick
out my email correctly in one and I might have replaced my clipboard by
then. So if the text from the capcha doesn't match the earlier email field,
error.

Now, the other part is the psychology on your end. What the hell is the
point of maintaining an email database that you're afraid people have
entered spam bot triggering emails into? You're either going to end up
sending to it eventually or you're asking your users (and us) to give you
information (or figure a way to get you correct information) for no good
reason (and possibly bad / nefarious reasons).

I'd also wait on collecting the email until you know you've got something
they want. If this is for password rests, try getting their phone number and
carrier name and using the carrier's email to sms gateway.

.... as I said, this seems to be more social than technical.

--002215975af2c3207e049dd17cee--
Shawn Wilson [ So, 06 März 2011 15:49 ] [ ID #2056241 ]

Re: Auto correction of typos

--00504502cc56e42e21049de1dfcf
Content-Type: text/plain; charset=ISO-8859-1

Now, the other part is the psychology on your end. What the hell is the

> point of maintaining an email database that you're afraid people have
> entered spam bot triggering emails into? You're either going to end up
> sending to it eventually or you're asking your users (and us) to give you
> information (or figure a way to get you correct information) for no good
> reason (and possibly bad / nefarious reasons).
>
> I'd also wait on collecting the email until you know you've got something
> they want. If this is for password rests, try getting their phone number
> and
> carrier name and using the carrier's email to sms gateway.
>
> ... as I said, this seems to be more social than technical.
>


I dont want to change the "Flow" of the system. If the current systems uses
mail for communication I dont think it will be reasonable for me to change
the system to use SMS , just because email-ids can be typo-ed

I think this is what I will do

1) Create a hash of aliases for frequently used domains and their typos
For eg
gmaill.com => gmail.com
hotmal.com => hotmail.com
etc

when I get the email id with these typos , I will prompt the user for
correction , If accepted then thats fine


--
Thanks
Ram
<http://www.netcore.co.in/>




n <http://pragatee.com>

--00504502cc56e42e21049de1dfcf--
Ramprasad Prasad [ Mo, 07 März 2011 11:22 ] [ ID #2056260 ]

Re: Auto correction of typos

On Sun, Mar 6, 2011 at 9:49 AM, shawn wilson <ag4ve.us [at] gmail.com> wrote:
> they want. If this is for password rests, try getting their phone number and
> carrier name and using the carrier's email to sms gateway.

You seem to be assuming that every user will have a mobile phone. :-X
That seems like a poor assumption to make.

--
Brandon McCaig <http://www.bamccaig.com/> <bamccaig [at] gmail.com>
V zrna gur orfg jvgu jung V fnl. Vg qbrfa'g nyjnlf fbhaq gung jnl.
Castopulence Software <http://www.castopulence.org/> <bamccaig [at] castopulence.org>

--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
Brandon McCaig [ Mo, 07 März 2011 17:33 ] [ ID #2056263 ]

Re: Auto correction of typos

On Mon, Mar 7, 2011 at 5:22 AM, Ramprasad Prasad <ramprasad.ap [at] gmail.com> w=
rote:
> 1) Create a hash of aliases for frequently used domains and their typos
> For eg
> =C2=A0gmaill.com =3D> gmail.com
> =C2=A0hotmal.com =3D> =C2=A0hotmail.com
> etc
>
> when I get the email id =C2=A0with these typos , I will prompt the user f=
or
> correction =C2=A0, If accepted then thats fine

It's difficult to predict every possible typo that a user is going to
make. They could have their hands off-by-one and type something
completely different. Perhaps you could instead just store a list of
common mail domains and warn the user to double-check if their E-mail
address doesn't match any of them.

--
Brandon McCaig <http://www.bamccaig.com/> <bamccaig [at] gmail.com>
V zrna gur orfg jvgu jung V fnl. Vg qbrfa'g nyjnlf fbhaq gung jnl.
Castopulence Software <http://www.castopulence.org/> <bamccaig [at] castopulence=
..org>

--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
Brandon McCaig [ Mo, 07 März 2011 17:37 ] [ ID #2056264 ]

Re: Auto correction of typos

--0015173ff0a843ca96049de7d785
Content-Type: text/plain; charset=ISO-8859-1

On Mar 7, 2011 11:37 AM, "Brandon McCaig" <bamccaig [at] gmail.com> wrote:
>
> On Mon, Mar 7, 2011 at 5:22 AM, Ramprasad Prasad <ramprasad.ap [at] gmail.com>
wrote:
> > 1) Create a hash of aliases for frequently used domains and their typos
> > For eg
> > gmaill.com => gmail.com
> > hotmal.com => hotmail.com
> > etc
> >
> > when I get the email id with these typos , I will prompt the user for
> > correction , If accepted then thats fine
>
> It's difficult to predict every possible typo that a user is going to
> make. They could have their hands off-by-one and type something
> completely different. Perhaps you could instead just store a list of
> common mail domains and warn the user to double-check if their E-mail
> address doesn't match any of them.
>

Yeah. However if he's going to go that far, he might as well just check for
an mx record for the domain.

Also, that hash is going to get unwieldy pretty quick. If there's no db
already, might want to use sqlite.

Heh, too bad he didn't like my capcha of the email address for confirmation.
I kinda think that was one of my better ideas. :)

--0015173ff0a843ca96049de7d785--
Shawn Wilson [ Mo, 07 März 2011 18:29 ] [ ID #2056265 ]

Re: Auto correction of typos

shawn wilson wrote:
> On Mar 7, 2011 11:37 AM, "Brandon McCaig" <bamccaig [at] gmail.com>
> wrote:
> >
> > On Mon, Mar 7, 2011 at 5:22 AM, Ramprasad Prasad
> > <ramprasad.ap [at] gmail.com>
> wrote:
> >> 1) Create a hash of aliases for frequently used domains and their
> >> typos For eg gmaill.com => gmail.com hotmal.com => hotmail.com
> >> etc
> >>
> >> when I get the email id with these typos , I will prompt the
> >> user for correction , If accepted then thats fine
> >
> > It's difficult to predict every possible typo that a user is going
> > to make. They could have their hands off-by-one and type something
> > completely different. Perhaps you could instead just store a list
> > of common mail domains and warn the user to double-check if their
> > E-mail address doesn't match any of them.
> >
>
> Yeah. However if he's going to go that far, he might as well just
> check for an mx record for the domain.
>
> Also, that hash is going to get unwieldy pretty quick. If there's no
> db already, might want to use sqlite.
>
> Heh, too bad he didn't like my capcha of the email address for
> confirmation. I kinda think that was one of my better ideas. :)
>
I agree -- I think you would spend considerable time attempting to
predict typos, when a simpler validation model could be written and
implemented relatively quickly. For instance, I would tackle this
problem with some straightforward client-side JavaScript. Before
passing the form results back to the server for processing (and further
validation if desired), you could use the prompt() or confirm() methods
of the Window object. With prompt(), you could require the user to
enter the address a second time. With confirm(), you could force them
to inspect the address before continuing on with submission. I'm not
sure if web bots could work through this logic and still spam you...

I'm not a big fan of my own suggestion, since encountering dialog boxes
while browsing can be annoying to the user. But, I think most types of
entry validation annoy users, even if it's for their own good. IMO, the
Capcha idea is probably the best "bang for the buck"; requires only
moderate coding (some are just copy-paste code snippets) and gives you a
high level of "human" authentication. The downside is that the capcha
phrases are sometimes ambiguous, and the user might have to try more
than once to submit.

A quick Google search revealed an article you may find useful, if you'd
still like to tackle the problem with your original idea:
http://www.infoq.com/articles/lucene-did-you-mean
Granted, it's not a Perl solution, but it is the same programming logic
you would need. Notice that it requires a suitable dictionary of
reference words (e-mail domains for your case) so you would still have a
lot of work to do...

Good Luck!
Brian


--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
byulga [ Mo, 07 März 2011 18:59 ] [ ID #2056266 ]
Perl » gmane.comp.lang.perl.beginners » Auto correction of typos

Vorheriges Thema: Class::Struct comparison & MOP
Nächstes Thema: Regular expression to delete from a string unseen characters