PhpDig.net

Go Back   PhpDig.net > PhpDig Forums > How-to Forum

Reply
 
Thread Tools
Old 03-13-2005, 10:04 PM   #1
jerrywin5
Orange Mole
 
Join Date: Mar 2004
Posts: 48
Indexing of numbers

Is it possible to index only phone numbers as in:

###-###-####
or
###-####
or
(###) ###-####
or
###.###.####
or
###.####

and not index other sets of numbers such as dates, times, dolar amounts, and misc. numbers?

I am lost when it comes to regular expressions.
jerrywin5 is offline   Reply With Quote
Old 03-15-2005, 09:29 AM   #2
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Perhaps modify the following line in robot_functions.php to insert words or telephone numbers:
Code:
// v.1.8.7
        if (strlen($key) > SMALL_WORDS_SIZE and strlen($key) <= MAX_WORDS_SIZE and !isset($common_words[$key]) and ereg('^['.$phpdig_words_chars[PHPDIG_ENCODING].'#$]',$key))

// v.1.8.8 RC1
        if (mb_strlen($key) > SMALL_WORDS_SIZE and mb_strlen($key) <= MAX_WORDS_SIZE and !isset($common_words[$key]))
Note though that PhpDig uses a space to separate 'words' so telephone numbers like "(xxx) xxx-xxx" for example might need to be considered near the $separators = " "; line in the robot_functions.php file.
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Old 03-16-2005, 08:37 AM   #3
jerrywin5
Orange Mole
 
Join Date: Mar 2004
Posts: 48
Thanks. I don't know how to work with regular expressions nor how to add one to this line of code. SInce this sounds like a complex issue to deal with, how can I keep from indexing all numbers?
jerrywin5 is offline   Reply With Quote
Old 04-06-2005, 01:08 PM   #4
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Try the following and see if it avoids all numbers:
Code:
// v.1.8.7
        if (!eregi("[0-9]",$key) and strlen($key) > SMALL_WORDS_SIZE and strlen($key) <= MAX_WORDS_SIZE and !isset($common_words[$key]) and ereg('^['.$phpdig_words_chars[PHPDIG_ENCODING].'#$]',$key))

// v.1.8.8 RC1
        if (!mb_eregi("[0-9]",$key) and mb_strlen($key) > SMALL_WORDS_SIZE and mb_strlen($key) <= MAX_WORDS_SIZE and !isset($common_words[$key]))
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Include Numbers which occur in names galacticvoyager How-to Forum 1 11-12-2005 01:45 PM
fuzzy search on product numbers indeh How-to Forum 0 10-13-2004 11:33 AM
Numbers everywhere... Nad Troubleshooting 10 07-14-2004 01:43 AM
Numbers BernhardG Bug Tracker 2 10-10-2003 04:20 AM
phpdig not index numbers. redlock Troubleshooting 6 10-06-2003 02:44 PM


All times are GMT -8. The time now is 01:23 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.