codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  huffman encoding and decoding in C++...  s970032 at 08:41 on Saturday, May 30, 2009
 

I'm very new to this Huffman concept and I was asked in my assignment to implement the following functions in my C++ program;

1. a function that reads a text message from a text file with a name entered by the user. It's also going to compute the frequency of each character used and display each character and its frequency.

2. a function that uses character frequencies above to generate Huffman code using priority queue and binary trees (STL data structures) and display binary code for each character.

3. a function that encodes the message read from the text file using Huffman code generated above and display the encoded message on screen.

4. a function that computes and displays the percentage of storage savings after data compression.

5. a function that decode the encoded message and displays the decoded message on screen.

any help is appreciated!!!

  Re: huffman encoding and decoding in C++...  jessonerik at 05:30 on Wednesday, October 14, 2009
 

This section explains the steps involved in creating any speech application. Once you have set up the environment, you are ready to write an application that does speech recognition and speech synthesis. The major tasks in creating any speech application are student loans

* Create a speech synthesis method.
* Create a speech recognizer, which is basically an event listener.
* Create a grammar file that stores all the valid keywords your recognizer should accept.
* Optionally, create a user interface, depending on the type of application you are creating. For example, getting stock quotes might not require a user interface. real estate agents

Before you run the sample application,

* Be sure Speech for Java and ViaVoice are installed.
* CLASSPATH AND PATH should be set in the environment. For information about setting these, see the README.HTML file provided with the Speech For Java install program.
* You should have a headset ready.
* Create a grammar file with all the valid names and order numbers that you want the Recognizer to capture when the application runs.
* Create an ORDERS table as shown below:
Column Name Column Type Description
ORRFNBR INTEGER NOT NULL Order Reference Number
SHOPPER_NAME CHAR (50) Full Name of the shopper
JOB_STATUS SMALLINT (2) Valid Values are:Y or N
ORSTAT CHAR (1) Valid values of Order status are: mortgage rates
P - Order in pending state
C - Order in completed state (order was placed)
X - Order was canceled

The following "AllSpeechApp" application demonstrates speech synthesis and speech recognition using JSAPI and IBM Speech for Java. In this application the speaker completes the form by speaking the information required, the application processes the information, then the computer speaks the result.

The application shows a real-time requirement of an eCommerce Web site where a shopper wants to know the current status of the order placed. The shopper provides the information (name, order number, and confirmation to e-mail notification), and the application returns the order status. There are three stages in this application:

1. A data entry form is displayed in Figure 2 below. At this point, the form takes voice input only, and can easily be enhanced for keyboard and mouse support. It is purposely set to voice-only mode so you can see the efficiency of Speech for Java with ViaVoice and JSAPI. mortgage loans

/**
* Listens and stores the spoken text.
* This is Speech Recognition method.
* This method also writes the text on the screen using CreateForm() method.
*/
public void resultAccepted(ResultEvent e)
{
try
{
Result r = (Result)(e.getSource());
ResultToken tokens[] = r.getBestTokens();

for(int i=0;i<tokens.length;i++)
{
newWord1 = newWord1.concat(tokens.getSpokenText());
newWord1 = newWord1.concat(" ");
}
int len_tokens= tokens.length;
if(len_tokens==2)
{
String name = tokens[0].getSpokenText().concat(" ");
name=name.concat(tokens[1].getSpokenText());
success_Name = createForm("Name",name);
}
if(success_Name)
{
order_rn.requestFocus();

//Sets the order number in the form
if(len_tokens == 1)
{
order_rn.setText("");
int numstarts = newWord1.indexOf("1");
orderNumber = newWord1.substring(numstarts,numstarts+2);
order_rn.setText(orderNumber);
} CodeToad

//Sets the order email notification flag to yes or no.
int email_status_yes = newWord1.indexOf("Yes");
int email_status_no = newWord1.indexOf("No");
if(email_status_yes>0)
{
email_status_y = newWord1.substring(email_status_yes,newWord1.length());
email_yes.setSelected(true);
submit.requestFocus();
}
else if(email_status_no>0)
{
email_status_n = newWord1.substring(email_status_no,newWord1.length());
email_no.setSelected(true);
submit.requestFocus();
}
email_statusYES=email_yes.isSelected();
email_statusNO =email_no.isSelected();


  Re: huffman encoding and decoding in C++...  davidvilla at 05:50 on Saturday, October 24, 2009
 

a function that uses character frequencies above to generate Huffman code using priority queue and binary trees (STL data structures) and display binary code for each character. Law School - Phd degrees - Master degree

  Re: huffman encoding and decoding in C++...  davidvilla at 05:51 on Saturday, October 24, 2009
 

The application shows a real-time requirement of an eCommerce Web site where a shopper wants to know the current status of the order placed. The shopper provides the information (name, order number, and confirmation to e-mail notification), and the application returns the order status. There are three stages in this application: Social Science School - online Phd degrees

  Re: huffman encoding and decoding in C++...  amery buck at 13:19 on Saturday, May 08, 2010
 

Beautiful blog with great informational content. Mostly certifications related and decoding in C++... related topics are really very good. testking 642-415, testking 642-611 and testking 642-654 are also good topics. Thanks for this great sharing.








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Need javascript code to identify non-searchable PDF
•  How work this reusable form validation script ?
•  Re: Copy files from one directory to another in a local network
•  DLL
•  calendar or event management
•  Re: how to convert wav file to text file
•  Re: huffman encoding and decoding in C++...
•  Re: How to Change user to root using ssh::expect
•  Re: Need hosted_button_id value from PayPal generated code


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2010