| View previous topic :: View next topic |
| Author |
Message |
Vic D'Elfant Past Contributor


Joined: 26 Jun 2002 Posts: 673 Location: The Netherlands
|
Posted: Thu Mar 18, 2004 4:17 pm Post subject: Less picky @equal |
|
|
Hi everyone,
I've been trying to create a program that asks me a word, for example, in English, and I have to enter the Dutch translation, to learn tests at school
The 'asking'-part works fine, but the program is kinda picky when accepting answers...
For example, if the correct answer would be 'spare time', and I entered 'spar time' (with a typo), the program says it's incorrect. Which actually is right, because I use @equal to compare the correct and the given anwer, but isn't it possible to let it be a bit less-picky, so these answers are also accepted?
I've been thinking about counting the sum of the ASCII codes of the correct answer and the sum of the ASCII codes of the given answer, and then calculate the difference, but this isn't reliable either...
Thanks in advance,
Vic _________________ phpBB Development Team |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Thu Mar 18, 2004 4:51 pm Post subject: |
|
|
Ya could try a routine with @substr() and make a few attempts
to check for partial spellings of the word. Maybe check 1/2 - 3/4
of the word length or so? Might use @pos() for this as well.
Just a thought...
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Thu Mar 18, 2004 6:52 pm Post subject: |
|
|
Perhaps you could spell check the string before doing the comparison?
Is there a spell check extension for VDS? _________________ The Tech Pro
www.tech-pro.net |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Fri Mar 19, 2004 8:50 am Post subject: |
|
|
hi vic,
i assume that you are entering somewhere along the way the correct answers for your program to check your entries against (bad english sentence this is!)...so why don't you add the mispelling that would be acceptable with a popup saying that you got part of the answer right
i would recommend parsing your answer and then checking each individual word against the correct spelling...if none are found then check it against a prepared list of acceptable spelling mistakes
does that make sense?
serge _________________
|
|
| Back to top |
|
 |
Protected Valued Contributor


Joined: 02 Jan 2001 Posts: 228 Location: Portugal
|
Posted: Fri Mar 19, 2004 10:40 am Post subject: |
|
|
| I agree with mac about the usage of @pos . It would be extremely useful in this case, allowing you to make a routine that would pick much more 'close-but-not-exactly-right' answers than if you defined them manually. I use that function all the time for this kind of stuff... |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Fri Mar 19, 2004 11:43 am Post subject: |
|
|
Or perhaps Vic shouldn't get into the habit of getting away with incorrect answers
How 'bout a math test: 12 +12 = 25! OK, that's fairly close - correct answer...
If I were the professor, I'd stick with @equal() and perhaps even add the EXACT parameter
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Fri Mar 19, 2004 11:00 pm Post subject: |
|
|
| A slang list or Spellchecker extinsion sounds good.. |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Fri Mar 19, 2004 11:25 pm Post subject: |
|
|
That's something that's been wanted for years.  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
|