Click here to Skip to main content
15,884,176 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello Everyone,

I was wandering that can i write a program to check if the input word (string) makes any sense(valid english word) according to the English Dictionary?

How will i do a comparison of that input string?

Please provide inputs.

Thanks,
Posted
Updated 12-Nov-13 21:19pm
v2
Comments
Ron Beyer 13-Nov-13 0:17am    
How do you know it makes sense according to a dictionary? If I wrote "The black carpet computer strand ups in ten", would pass a dictionary test, but makes no "sense"... In order for a computer to determine if something conveys a complete idea (sense), that's still a concept scientists are trying to break...
Sergey Alexandrovich Kryukov 13-Nov-13 0:34am    
Exactly. I would post it as an answer.

I would add: the content of OP's post would pass a dictionary test but does not really make sense. Nevertheless, not only a computer program, but even OP failed to recognize it.

—SA
adityasahver 13-Nov-13 1:35am    
Ok may be the words that I used are a bit vague. What i meant is, if the input string is "asfaga", then the program should check if the input string is there in the English Dictionary, if yes it will return something if no it will throw an error. How can i perform this check, do i have to use a third party web service or is there a way to write this logic in a simpler way? I hope this is making more sense now, please suggest.
♥…ЯҠ…♥ 13-Nov-13 3:20am    
I think you want to implement Spell check program? am i right?
adityasahver 13-Nov-13 8:42am    
yes got it.. but is there any .net inbuild class which i can use. I on the net found aspell.net and other which are 3rd party APIs, i wanted to avoid this..

1 solution

Single words do not make any "sense" without context. A dictionary can only help you determine if the word is spelled correctly, but for something to make sense you have to convey a complete idea in a context.

This is a very budding area of artificial intelligence, the ability for a computer system to determine if a set of words both forms a sentence (easy) and conveys a complete idea (right now impossible).

The reason a computer can't determine if something makes sense or not is because a computer can't guess context or rationality. This is just not possible with today's technology.

For example, the word "orange" doesn't make any sense by itself. Are you talking about the color, or the fruit? Put it in a sentence like "My orange tastes like beef", has correctly spelled words, conveys a complete idea, but doesn't make any sense. We know this because we know what oranges taste like, and we know what beef tastes like, but oranges do not taste anything like beef.
 
Share this answer
 
Comments
adityasahver 13-Nov-13 1:35am    
Ok may be the words that I used are a bit vague. What i meant is, if the input string is "asfaga", then the program should check if the input string is there in the English Dictionary, if yes it will return something if no it will throw an error. How can i perform this check, do i have to use a third party web service or is there a way to write this logic in a simpler way? I hope this is making more sense now, please suggest.
Ron Beyer 13-Nov-13 1:37am    
What you are asking for is a simple spell check, search google for "C# Spell Check" and you'll get many examples of how to implement this.

adityasahver 13-Nov-13 8:43am    
yes got it.. but is there any .net in build class which i can use. I on the net found aspell, NHunspell other which are 3rd party APIs, i wanted to avoid this..
phil.o 13-Nov-13 3:24am    
You should buy your fruits and vegetables elsewhere :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900