Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Given an article such as this one at nytimes.com, design an algorithm to find th

ID: 3677020 • Letter: G

Question

Given an article such as this one at nytimes.com, design an algorithm to find the most frequently co-occurring word-pair in this article. Two words are said to co-occur if they appear in the same sentence. If the words appear multiple times in a single sentence, that still counts as one co-occurrence. You can assume you have access to a subroutine, sentenceSplitter(article), that can accurately segment an article into separate sentences. You can also assume you have access to a subroutine called wordSplitter(sentence) that can accurately split a sentence into words. Please describe your algorithm unambiguously using pseudo code with necessary comments in English. Assume you start with an "article" variable that already contains the full text of an article. Given P={p_1, p_2,..., p_m}, the set of products available at a local grocery store; D={T_1, T_2,..., T_N}, the set of transactions that were completed at this store in the past year, where each T_i (i in [1,N]) is a subset of P; min_freq, a user-specified parameter (e.g., 5%). A product is said to be frequent if it occurs in at least min_freq of the transactions in D. By the same token, a pair of products is said to be frequent if it occurs in at least min_freq of the transactions in D. Also, it's straightforward to prove the following claim: if a product is not frequent, none of the pairs that involve this product will be frequent. Use this claim to design an algorithm to find all the frequent products and frequent product pairs in D. Represent your algorithm in pseudo code.

Explanation / Answer

#include<stdio.h>

#include<conio.h>

#include<string.h>

void main()

{

string str;

char c;

int count;

void getline()

{

prntf(" Enter string to be scanned");

scanf("%s", str);

}

int countcoOccurence(string str)

{

printf(" Read each word in the string");

str[0]=c;

c=c+1;

if(c==c+1)

count=count+1;

}

void coOccuringFeq

{

string pair;

int feq,largest;

int n;

pair[n-1]= array[n-1].pair;

feq=pair[n-1];

prinrf(" the frequency is:", feq);

}

void index1()

{

int index,i;

for(i = 0; i < str, i++)

{

while(str_position != ".")

{

if(array[current].pair == array[anything_already_in_array].pair)

{

//doesnt add to array if pair alreay in the string array and instead increments //freq by 1

else

{

}

}

}

}

printf ( "Most co-occuring pair is",pair[largest] and " occuring ", array[largest] and " times.";

}

pair[0] = array[0].pair; pair[1] = array[1].pair; pair[1] = array[2].pair; pair[3] = array[3].pair;
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote