|
Send me an email at:
luis uebel at g m ail d ot com
Please remove spaces, just to reduce spams.
|
|
|
|
|
PLP is a type of speech recognition feature vector.
Please send me your email to contact you.
Luis
|
|
|
|
|
Would you to post your project here?
I am sure there are a lot of interested in Speech recognition.
Thanks,
|
|
|
|
|
Im having problem with the output of this program that i made that supposed to count the numbers of successful a's and b's based on the pattern indicated in my condition.
*********************************************************************
#include<iostream>
using namespace std;
int main()
{
int lookahead;
int q1=0, q2=0, q3=0, q4=0, q5=0, q6=0;
int count_a=0;
int count_b=0;
while((lookahead = getchar())!='.')
{
switch(lookahead)
{
case 'a':{
if(q1==0 && q2==0 && q3==0 && q4==0 && q5==0 && q6==0)
{
q1=0;
q2=1;
q3=0;
q4=0;
q5=0;
q6=0;
}
else if ( q1==0 && q2==1 && q3==0 && q4==0 && q5==0 && q6==0 )
{
q1=0;
q2=1;
q3=1;
q4=0;
q5=0;
q6=0;
}
else if ( q1==0 && q2==1 && q3==1 && q4==0 && q5==0 && q6==0)
{
q1=0;
q2=0;
q3=0;
q4=0;
q5=0;
q6=0;
count_a++;
}
else if ( q1==0 && q2==0 && q3==0 && q4==1 && q5==0 && q6==0)
{
q1=0;
q2=1;
q3=0;
q4=0;
q5=0;
q6=0;
}
else if (q1==0 && q2==0 && q3==0 && q4==1 && q5==1 && q6==0)
{
q1=0;
q2=1;
q3=0;
q4=0;
q5=0;
q6=0;
}
}
break;
case 'b':{
if(q1==0 && q2==0 && q3==0 && q4==0 && q5==0 && q6==0)
{
q1=0;
q2=0;
q3=0;
q4=1;
q5=0;
q6=0;
}
else if ( q1==0 && q2==0 && q3==0 && q4==1 && q5==0 && q6==0 )
{
q1=0;
q2=0;
q3=0;
q4=1;
q5=1;
q6=0;
}
else if ( q1==0 && q2==0 && q3==0 && q4==1 && q5==1 && q6==0)
{
q1=0;
q2=0;
q3=0;
q4=0;
q5=0;
q6=0;
count_b++;
}
else if ( q1==0 && q2==1 && q3==0 && q4==0 && q5==0 && q6==0)
{
q1=0;
q2=0;
q3=0;
q4=1;
q5=0;
q6=0;
}
else if (q1==0 && q2==1 && q3==1 && q4==0 && q5==0 && q6==0)
{
q1=0;
q2=0;
q3=0;
q4=1;
q5=0;
q6=0;
}
}
break;
default:{
q1=0;
q2=0;
q3=0;
q4=0;
q5=0;
q6=0;
}
}
cout<<"\n count_a :"<<count_a;
cout<<"\n count_b :"<<count_b;
}
return 0;
}
*****************************************************************
when i didnt enter any letter the output is:
count_a: 0
count_b: 0
when the letter increase the number of count display multiplies too and it shouldnt'..
like this; input words "aaa"
count_a: 0
count_b: 0
count_a: 0
count_b: 0
count_a: 1
count_b: 0
count_a: 1
count_b: 0
Where do you think is the problem on my codes?
modified on Tuesday, October 20, 2009 2:00 PM
|
|
|
|
|
Please post such code with the code block.
|
|
|
|
|
done ^_^... sorry newbie here
|
|
|
|
|
What should be the exact output for input "aaa" ?
Have you tried "running" this on paper ? ie. do all of the operations on paper with a pencil ? follow each step manually.
Did you try debugging, i.e. stepping in the code after each getchar ?
Put a breakpoint at the switch and try following what is happening.
good luck.
This signature was proudly tested on animals.
|
|
|
|
|
the exact output for "aaa" should be"
count_a: 1
count_b: 0
Its a program for a Finite State Machine that accept a language that has 3 consecutive letters in the end.
Thats the diagram.
<a href="http://s137.photobucket.com/albums/q222/riel_tp/?action=view¤t=no_1.jpg" target="_blank"><img src="http://i137.photobucket.com/albums/q222/riel_tp/no_1.jpg" border="0" alt="no_1"></a>
*** I'll try to do what you said... ***
Thanks, pls check the above details too ^_^
|
|
|
|
|
songryong wrote: Its a program for a Finite State Machine...
I've never seen an FSM that looks like this. How about something along the lines of:
void state0( void )
{
if (buffer[pos] == 'a')
{
pos++;
state1();
}
else if (buffer[pos] == 'b')
{
pos++;
state3();
}
}
void state1( void )
{
if (buffer[pos] == 'a')
{
pos++;
state2();
}
else if (buffer[pos] == 'b')
{
pos++;
state3();
}
}
...
void state5( void )
{
valid = true;
}
void main( void )
{
state0();
if (valid)
cout << "Valid" << endl;
else
cout << "Not valid" << endl;
}
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
The diagram is... it was given to us to confirm the language the machine accept through this program if its valid or not....
hhmmmm im still 2 months old in c++ .... so i need to study the codes you have given to me above...... thanks a lot for your help ^_^
|
|
|
|
|
songryong wrote: The diagram is... it was given to us to confirm the language the machine accept through this program if its valid or not....
There was nothing with the diagram. It was your implementation of it that I had trouble with.
songryong wrote: hhmmmm im still 2 months old in c++...
Other than using cout , the code snippet I showed was plain C. No objects were used or are required.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
i haven't used some of those codes before..
sorry for the bad implementation. I'll see what i can do with it.. thanks for your help... i realize what i need to do with it.. ^_^
|
|
|
|
|
Is it possible to create a driver as an ActiveX control/component in VC++ or even in .Net? If so, how can it be done? Thanks in advance.
Don't steal, the government doesn't like competition.
-Ron Paul
|
|
|
|
|
What do you mean "driver"? If it is a file like "*.sys". Then I think it is impossible. They are totally different concepts.
|
|
|
|
|
I apologize for not being more specific. I was thinking more along the lines of creating an interface that inherited classes/variables/properties from the ddk. I hope I described it better. Thanks in advance
Don't steal, the government doesn't like competition.
-Ron Paul
|
|
|
|
|
COM is used to design an interface. It does not require DDK. What do you want to use the interface?
|
|
|
|
|
Hello,
I am facing a problem with registry key. I have a MFC singledoc application with three splitters and lots of views. My registry key was set in InitInstance function by SetRegistryKey(_T("Local AppWizard-Generated Applications")). Everything works fine till the moment I try to change the string parameter in SetRegistryKey() function. When I change it I recieve many strange error during initialization and opening new document. Can you tell me what is going on? Thanks Tomas
|
|
|
|
|
Tomas(cz) wrote: I recieve many strange error during initialization and opening new document. Can you tell me what is going on?
Not without more information! Please post the portion of code that is failing, including the exact line where the error occurs, and the messages that you receive.
|
|
|
|
|
Thanks for your reply,
the error message is Unhandled exception at 0x7c812afb in Amason.exe: Microsoft C++ exception: std::__non_rtti_object at memory location 0x0012f314.. and it occurs in CFrameWnd::InitialUpdateFrame in function SendMessageToDescendants. I also recieved this warning Warning: failed to load indicator string 0x8017. When I change the registry key back to the original value, everything works fine...
Tomas
|
|
|
|
|
Hi,
I have a VC++ desktop application. It is an SDI application with some HTML views.
When I close the application and re-start the machine I m facing
BOOT FAILURE error. Then I give load the BOOT CD and select repair it things will work fine.
This is not replicable, but happens rarely that too in few machines.
When I turn on UAC and run my application with Standard Priviledge things are working fine.
System Event logs does not provide any clue.
Boot logs(ntbtlog) from system dir also didn't help.
How do I proceed?
Any help to resolve this.
Regards,
Karthik.
|
|
|
|
|
I suspect, your application is playing around with the system files.
That is why when you run with standard privileges, the application fails to do its stuff and everything is OK.
|
|
|
|
|
Hi
Please How to convert BSTR to AnsiString? thanks a lot
|
|
|
|
|
The easiest way is to use the _bstr_t class.
BSTR bstr;
_bstr_t _bstr(bstr, true);
const int size = 256;
char ansi[size];
strcpy_s(ansi, size, static_cast<char*>(_bstr));
|
|
|
|
|
thanks a lot, but it doesn't compile in C++ borland
regards
|
|
|
|
|
What would be the best way to read complete messages from a growing file in which each complete entry when written is linefeed terminated? Basically, I want to simultaneously read a file while another process is appending to it, then when I reach the end wait on any further data and return from the "read" only when there's a complete message to process.
I can write code that manages this myself, but just curious to learn if there's anything out there that can already do this.
Thanks
|
|
|
|