473,326 Members | 2,192 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Help on a how to count word frequency.

i have an array pages = ["www.ebay.com: An auction website where users can buy and sell items. ","www.bbc.co.uk: The official site for the British Broadcasting Center"];

the user is asked to enter a word 'w', which is then searched for in the above array. I want the frequency of that word in pages[0] outputed, then the frequency of the same word in pages[1] outputed, and so on.

I dont know where to start, if anyone could post some sample code for me to see what i need to do, that would be greatly appreciated.
Nov 11 '07 #1
1 2536
r035198x
13,262 8TB
i have an array pages = ["www.ebay.com: An auction website where users can buy and sell items. ","www.bbc.co.uk: The official site for the British Broadcasting Center"];

the user is asked to enter a word 'w', which is then searched for in the above array. I want the frequency of that word in pages[0] outputed, then the frequency of the same word in pages[1] outputed, and so on.

I dont know where to start, if anyone could post some sample code for me to see what i need to do, that would be greatly appreciated.
You could use a nested loop, the outer one going through the array of pages the inner one going through each element of the array matching and counting the frequency of the entered word.
For the inner loop you may want to consider the use of regular expressions.
Nov 12 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Rob | last post by:
Hi, I have been asked by a customer to try to resurrect a rather ancient application their organisation uses that was written in Clipper. This I am fine with. However, there is a module that was...
66
by: genestarwing | last post by:
QUESTION: Write a program that opens and read a text file and records how many times each word occurs in the file. Use a binary search tree modified to store both a word and the number of times it...
0
by: mpilman | last post by:
The following oracle query purports to output a word count for all words found in a table column. Is this possible in MYSQL? Mike =================================================== Measuring...
3
by: waynejr25 | last post by:
can anyone debug my program and get it to run. #include <fstream> #include <iostream> #include <string> #include <cstdlib> #include <map> using namespace std;
0
by: alivip | last post by:
Is python provide search in parent folder contain sub folders and files for example folder name is cars and sub file is Toyota,Honda and BMW and Toyota contain file name camry and file name corola,...
11
by: alivip | last post by:
how to ingrate my code to read text in in parent folder contain sub folders and files for example folder name is cars and sub file is Toyota,Honda and BMW and Toyota contain file name Camry and...
1
by: alivip | last post by:
I integrat program to be GUI using Tkinter I try browser direction as you can see # a look at the Tkinter Text widget # use ctrl+c to copy, ctrl+x to cut selected text, # ctrl+v to...
0
by: alivip | last post by:
I write code to get most frequent words in the file I won't to implement bigram probability by modifying the code to do the following: How can I get every Token (word) and ...
5
by: alivip | last post by:
How can I get every Token (word) and PreviousToken(Previous word) From multube files and frequency of each two word my code is trying to get all single word and double word (every Token (word) and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.