1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

counting the percentage and occurence of each identical word in input file

Discussion in 'C' started by fhmm, Oct 2, 2006.

  1. fhmm

    fhmm New Member

    I am an intermediate programmer and i tried to solve the following programme but with no success the programme is a simple text analyzer that read an input file and cumpute the occurence and percentage of each similar word .for example lets consider the following input file.

    "The for structure totals the elements of the array one row at the time. The outer for structure begins by setting row of the array to 0."

    the analysis of the programme shold be the following:

    Word///////////////// Frequency ////////////// %
    the///////////// 6 ///////////// 22.25%
    for//////////// 2 //////////// 7.41%
    structure///////// 2 /////////// 7.41%
    totals /////////// 1 ////////// 3.70%
    elements /////// 1 ///////// 3.70%
    of ////// 2 //////// 7.41%
    Array//////// 2 ////// 7.41%
    one//////// 1 //////// 3.70%
    row/////////// 2 //////// 7.41%
    at/////////// 1 ////// 3.70%
    time/////////// 1 ///// 3.70%
    outer ////////// 1 //// 3.70%
    begins /////// 1 /// 3.70%
    by ////// 1 // 3.70%
    setting ///// 1 ///// 3.70%
    to ///// 1 ///// 3.70 %
    0 //// 1 //// 3.70%

    Total words////////////////////////// 27
     
  2. shabbir

    shabbir Administrator Staff Member

    Refer [thread=1518]Counts each alpahbets occurs how many times[/thread]. The article counts the characters but the words would not be any different. Also the percentage can easily be derived if you have the figures.
     

Share This Page