How to check if a word is defined in the English dictionary in cocoa -touch?

I am trying to do a crossword for iOS, but I do not know how to check the correctness of the line in English or not.

How can I check this. Is there any API or online object to test it. Thanks at Advance

+4
source share
2 answers

Easy to do in iOS5 using the UIReferenceLibraryViewController class' +dictionaryHasDefinitionForTerm: method.

A UIReferenceLibraryViewController object provides a dictionary to find a definition of terms. You create and initialize the reference library view manager using the initWithTerm: method . You pass this term to be defined as a parameter of this method and the definition is displayed. You can submit this view controller or as part of another interface. On iPad, you can set the library controller link as the content view controller for the UIPopoverController object. If desired, use the dictionaryHasDefinitionForTerm: class method to check whether a defined definition is available for a specific term before instantiating, for example, use this method if you want to change the user interface depending on whether a definition is available.

+5
source

There is no API for this.

To do this, you will need a dictionary file (text file or database) in your application. One of the fastest ways to check is to load the dictionary into memory when the application starts, so you do not need to read a file for each word. This may be redundant if you just want hard-coded crosswords, but if you arbitrarily generate them, this is necessary.

0
source

Source: https://habr.com/ru/post/1379632/


All Articles