hi again. i was searching around the forums for a modification that would let my search simply ignore common words (not by numbers) such as 'and', 'of', 'it', 'the' etc. but couldn't find a definitive answer. i believe the ask.com mod ignores every instance of say, 'and', so basically every word that contains those letters in the exact order will be stripped of. like 'andrew' will be treated as 'rew' and 'bandstand' as 'bdstd'. please help! thank you!
Jul 12, 2001, 11:50 PM
Veteran / Moderator (1936 posts)
Jul 12, 2001, 11:50 PM
Post #2 of 4
Views: 1301
If you believe that's a case you can just change the regexpr to remove whole words only.
without seeing the codes used, I'd say something like...
foreach my $term (@query) {
(@query = grep {!/^$term$/} @query) if ( grep {/^$term$/} @ignored);
}Happy coding,
--Drew
http://www.camelsoup.com/links_mods/
without seeing the codes used, I'd say something like...
Code:
my @ignored = qw(a i if is an it so to do); foreach my $term (@query) {
(@query = grep {!/^$term$/} @query) if ( grep {/^$term$/} @ignored);
}
--Drew
http://www.camelsoup.com/links_mods/
Jul 13, 2001, 2:58 PM
User (70 posts)
Jul 13, 2001, 2:58 PM
Post #4 of 4
Views: 1286
alright, got to solve my problem. using what junko posted and bmx's mod, i combined these to simply ignore every common word written in blockterm.txt. it's different because if you type in "What is a bandstand?" as your query it ignores the common words (what is a) and does the search only on bandstand. it doesn't block, it skips, ignores, whatever you want to call it and searches on the remaining words. moverover, 'bandstand' remains intact and not treated as 'bstd' just because it contains 'and' in it.
thanks for everyone's help. took me the whole of yesterday and until 9pm tonight to solve this dilemma. perl is such a pain, but a joy at the same time. thanks bmx and junko!! i'll have to do more testing before i could post it here if anyone wants it.
thanks for everyone's help. took me the whole of yesterday and until 9pm tonight to solve this dilemma. perl is such a pain, but a joy at the same time. thanks bmx and junko!! i'll have to do more testing before i could post it here if anyone wants it.