[PHP] How can I check for variances in spelling within form text input fields?

2002-10-02 Thread DonPro

Hi,

I would like some ideas on how to perform the following.  Any input from the
PHP gurus would be appreciated.

I have a form where my customer feels out certain information.  Part of this
information is the company name, address, city and state/province of their
customer.  I have to assign a unique number to their customer based on the
information they typed in.

Here is my problem:

1) They may enter the same customer twice but have a slightly different
spelling (maybe adding a LTD. to the company name)
2) Two of my customers may have the same customer. They will type it into my
form but again with variant spelling.

I would like to know if there is an algorithm which allows me to check for
small variances in spelling so that I would know if this customer has
already been assigned my unique number and therefore not assign a duplicate
number.

Thanks,
Don



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] How can I check for variances in spelling within form text input fields?

2002-10-02 Thread Debbie Dyer

Don

I am not a 'PHP guru' and I dont know where you can find an algorithm but:-

If the only problem is users adding/not using name extensions, then for your
company exists already test you could remove known extensions from the input
company name - ltd, plc, etc - and replace this with a wildcard for the
check.

 eg. SELECT id FROM table WHERE name LIKE '$input_name_without_extensions%'

Debbie

- Original Message -
From: DonPro [EMAIL PROTECTED]
To: php list [EMAIL PROTECTED]
Sent: Wednesday, October 02, 2002 4:27 PM
Subject: [PHP] How can I check for variances in spelling within form text
input fields?


 Hi,

 I would like some ideas on how to perform the following.  Any input from
the
 PHP gurus would be appreciated.

 I have a form where my customer feels out certain information.  Part of
this
 information is the company name, address, city and state/province of their
 customer.  I have to assign a unique number to their customer based on the
 information they typed in.

 Here is my problem:

 1) They may enter the same customer twice but have a slightly different
 spelling (maybe adding a LTD. to the company name)
 2) Two of my customers may have the same customer. They will type it into
my
 form but again with variant spelling.

 I would like to know if there is an algorithm which allows me to check for
 small variances in spelling so that I would know if this customer has
 already been assigned my unique number and therefore not assign a
duplicate
 number.

 Thanks,
 Don



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] How can I check for variances in spelling within form text input fields?

2002-10-02 Thread Chris Hewitt

Debbie Dyer wrote:

company exists already test you could remove known extensions from the input
company name - ltd, plc, etc - and replace this with a wildcard for the
check.

- Original Message -
From: DonPro [EMAIL PROTECTED]

information is the company name, address, city and state/province of their
customer.  I have to assign a unique number to their customer based on the
information they typed in.

Here is my problem:

1) They may enter the same customer twice but have a slightly different
spelling (maybe adding a LTD. to the company name)
2) Two of my customers may have the same customer. They will type it into

Sorry this post is OT. I think name matching is quite a problem, I've 
never found a foolproof way around it. Debbie's answer is good for the 
question you ask, but still many cases fall through. In the UK, British 
Telecom years ago changed its name to BT but both get used. Post 
Office changed its name to Consignia and now back again to Post 
Office. Then one company buys out another e.g. Foo Ltd buys Bar 
Ltd. I don't think you should go by the name alone.

Use the post/zip code too. In the UK, a street number (or name) plus the 
postcode is unique to a building (though it does not help with several 
companies/appartments in the same building). The post/zip code matching 
will not help with companies with more than one site.

HTH
Chris



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php