I am trying to make a crossword app for IOS but i Don't know that how to check if a string is valid english word or not.
How can i check it. Is there any API or online facility to check it. Thanks in Advance
I am trying to make a crossword app for IOS but i Don't know that how to check if a string is valid english word or not.
How can i check it. Is there any API or online facility to check it. Thanks in Advance
Easy to do in iOS5 using the UIReferenceLibraryViewController
class' +dictionaryHasDefinitionForTerm:
method.
A UIReferenceLibraryViewController object provides a dictionary service to look up the definition of terms. You create and initialize a reference library view controller using the initWithTerm: method. You pass the term to define as the parameter to this method and the definition is displayed. You can present this view controller modally or as part of another interface. On iPad, you can set the reference library view controller as the content view controller of a UIPopoverController object. Optionally, use the dictionaryHasDefinitionForTerm: class method to check if a definition is available for a given term before creating an instance—for example, use this method if you want to change the user interface depending on whether a definition is available.
There is no API for this.
In order to do this, you will need to have a dictionary file (text file or database) in your application bundle. One of the faster ways to check will be to load the dictionary into memory when the application launches so you don't have to read the file for each word. This may be overkill if you simply want hardcoded crosswords, but if you are randomly generating them then this is a must.