Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A VERY DIFFICULT TASK: COMPARING 2

Status
Not open for further replies.

Cballe

Programmer
Apr 14, 2002
16
ZA
Hi there,

I would appreciate it very much if someone could help me with this tough problem:

I am currently busy with a speech recognition program that I am writing, but as part of the program, the following task must be done:

RichTextBox 1 displays the text (say for instance, 50 words are in the sentence) that the user must read. As the user reads the text, the text that is heard by the computer, is displayed in RichTextBox2. Thus, after the user have finished reading the text in RichTextBox1, the text in RichTextBox2, must be the same as in RichTextBox1. Now comes the difficult part:

When a button is clicked (say for instance the button has the caption:Result) a percentage must be given (by displaying result in textbox) of how accurate the text in RichTextBox2, compares with the text in RichTextBox1. I thought of something like to give the user 2% for every word he gets right (50 words x 2% = 100). I really don’t know how to do this guy. Please help me with this. I know someone can help me with this that is why I turned to you guys….


Thanks
Best regards
C.P. Lombard
cplombard@hotmail.com
 
simple algebra:

TotalNumberOfWords = 100%

IndividualWords(seperated by spaces) = 10

PointsPerWord = (100/10)
PointsPerWord = [red]10[/red]

Highest possible PointsPerWord is 10 points for each word matched.
-------

IndividualWords(seperated by spaces) = 20

PointsPerWord = (100/20)
PointsPerWord = [red]5[/red]

Highest possible PointsPerWord is 5 points for each word matched.

Easy huh? --MiggyD

Never be afraid to try something new. Remember that amateurs built the Ark. Professionals built the Titanic.
 
The biggest challenge will be when the Speach recognition software enters different amounts of words into the one RichTextBox.
If comparing Word for Word then every word after the first one found wrong would also be found wrong.

Example:
RichTextBox1 holds the words that the user is to speak into the mic
The words are: "This little test will show how accurate..."

However; the recognition software misinterpret
the words as "Thistle test will show how accurate ...." which is now wrtten to RichtextBox2

A word for word comparison would mean that everything was wrong:

Word RichText1 RichText2 Match
1 This Thistle False
2 Little test False
3 test will False
etc...................................



 
Not sure which Speach Recognition engine you are using but if you have access to the SDK perhaps you can perform the comparison as the user speaks. Keep count of the failed matches and only write to RichTextBox2 when the macth is a success (This way the user knows what is happening). Then its total failed divided by success word count.

Pseudocode

If RecognitionReturn = Word(i) then
Pass = Pass + 1
RichTextBox2.Text = RichTextBox2.Text & Word(i)
test Word(i + 1)
else
Fail = Fail + 1
retest word(i)
end if

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top