NSOrthography Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/Foundation.framework |
| Availability | Available in iOS 4.0 and later. |
| Declared in | NSOrthography.h |
Overview
The NSOrthography class describes the linguistic content of a piece of text, typically used for the purposes of spelling and grammar checking.
An NSOrthography instance describes:
Which scripts the text contains.
A dominant language and possibly other languages for each of these scripts.
A dominant script and language for the text as a whole.
Scripts are uniformly described by standard four-letter tags (Latn, Grek, Cyrl, etc.) with the supertags Jpan and Kore typically used for Japanese and Korean text, Hans and Hant for Chinese text; the tag Zyyy is used if a specific script cannot be identified. See Internationalization Programming Topics for more information on internationalization.
Languages are uniformly described by BCP-47 tags , preferably in canonical form; the tag und is used if a specific language cannot be determined.
Subclassing Notes
Methods to Override
The dominantScript and languageMap properties are the primitive values that a subclass must implement. The properties are set using the initWithDominantScript:languageMap: or orthographyWithDominantScript:languageMap:.
Tasks
Creating Instances of NSOrthography
Defining the Language Map
-
dominantScriptproperty -
languageMapproperty
Managing Languages and Scripts
-
– languagesForScript: -
– dominantLanguageForScript: -
allLanguagesproperty -
allScriptsproperty -
dominantLanguageproperty
Properties
allLanguages
Returns an array containing all the languages appearing in the values of the language map. (read-only)
Availability
- Available in iOS 4.0 and later.
Declared In
NSOrthography.hallScripts
Returns an array containing all the scripts appearing as keys in the language map. (read-only)
Availability
- Available in iOS 4.0 and later.
Declared In
NSOrthography.hdominantLanguage
Returns the first language in the list of languages for the dominant script. (read-only)
Availability
- Available in iOS 4.0 and later.
Declared In
NSOrthography.hdominantScript
The dominant script for the text. (read-only)
Discussion
The dominant script should be a script tag, such as Latn, Cyrl, etc.
Availability
- Available in iOS 4.0 and later.
See Also
Declared In
NSOrthography.hlanguageMap
A dictionary that map script tags to arrays of language tags. (read-only)
Discussion
The dictionary’s keys are script tags (such as Latn, Cyrl, and so forth) and whose values are arrays of language tags (such as en, fr, de, etc.)
Availability
- Available in iOS 4.0 and later.
See Also
Declared In
NSOrthography.hClass Methods
orthographyWithDominantScript:languageMap:
Creates and returns an orthography instance with the specified dominant script and language map.
Parameters
- script
The dominant script.
- map
A dictionary containing the language map.
Return Value
An initialized orthography object for the specified script and language map.
Availability
- Available in iOS 4.0 and later.
Declared In
NSOrthography.hInstance Methods
dominantLanguageForScript:
Returns the dominant language for the specified script.
Parameters
- script
The script.
Return Value
A string containing the dominant language
Availability
- Available in iOS 4.0 and later.
Declared In
NSOrthography.hinitWithDominantScript:languageMap:
Creates and returns an orthography instance with the specified dominant script and language map.
Parameters
- script
The dominant script.
- map
A dictionary containing the language map.
Return Value
An initialized orthography object for the specified script and language map.
Availability
- Available in iOS 4.0 and later.
Declared In
NSOrthography.h© 2010 Apple Inc. All Rights Reserved. (Last updated: 2010-04-13)