How to do text mining in php??

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kiko
Forum Newbie
Posts: 23
Joined: Fri Sep 07, 2007 6:42 am

How to do text mining in php??

Post by kiko »

Hi all,
Does anyone know how to do text mining in php??thanks in advance.
Last edited by kiko on Fri Nov 23, 2007 9:28 am, edited 1 time in total.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Yes.
User avatar
aaronhall
DevNet Resident
Posts: 1040
Joined: Tue Aug 13, 2002 5:10 pm
Location: Back in Phoenix, missing the microbrews
Contact:

Post by aaronhall »

Me too
Rovas
Forum Contributor
Posts: 272
Joined: Mon Aug 21, 2006 7:09 am
Location: Romania

Post by Rovas »

kiko,
First: You put the question of the topic wrong: How do to .... .
Second: Another question wrong: Does anyone ....
Third (most important): Before posting do a little search for your problems on the net, this forum, find and read book, write some code. After some of these options you didn' t find anything, the script didn' t work you post.
Fourth: I don' t understand exactly want you need with text mining.
kiko
Forum Newbie
Posts: 23
Joined: Fri Sep 07, 2007 6:42 am

Post by kiko »

yes, i did. Hi Rovas, are you english teacher/lecturer? :D Anyway thanks for telling me my grammar mistakes. I had found the data/text mining from the net before. Basically, the steps are:

1. Fetch HMTL page
2. Strip off the HTML tags
3. Reformat HTML, adjust spacing and remove entities
4. Match content with regular expressions
5. Store content into database

Hopefully i'm not wrong. If I'm wrong, please advice. But now the text mining that I want is like:
When i store a sentence or a paragraph of text into database, it will automatically store some words into my database. for example:
I go to school. The word that will store into database is "school" and it will ignore the "I" and "go to". I think is something like google search.

Now I'm thinking of two ways to do it.
1: static the word first. Like I set "school" will not be strip off.
2: let it be automated.

please advice, thanks.
Rovas
Forum Contributor
Posts: 272
Joined: Mon Aug 21, 2006 7:09 am
Location: Romania

Post by Rovas »

You can use strpos to find the word your searching for (the example given is very helpfull) then add it to the database using mysql_query with an insert query.
Regular expressions are useful when comparing a string that contains many words not such one small word.
You automated by making the script run when the user adds a new entry or you make several functions or a class that search the over the net but I can' t help you here.
kiko
Forum Newbie
Posts: 23
Joined: Fri Sep 07, 2007 6:42 am

AOL Speak

Post by kiko »

ok, thanks Rovas I'll read through it...because i'm not so familiar with the text mining, if still have other question will keep to post it here...thanks..
Post Reply