Mac Developer Library

Developer

Foundation Framework Reference NSOrthography Class Reference

Options
Deployment Target:

On This Page
Language:

NSOrthography

The NSOrthography class describes the linguistic content of a piece of text, typically used for the purposes of spelling and grammar checking. More...

Inheritance


Conforms To


Import Statement


import Foundation @import Foundation;

Availability


Available in OS X v10.6 and later.
  • The dominant script for the text. (read-only)

    Declaration

    Swift

    var dominantScript: String { get }

    Objective-C

    @property(readonly, copy) NSString *dominantScript

    Discussion

    The dominant script should be a script tag, such as Latn, Cyrl, etc.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.6 and later.

    See Also

    languageMap

  • A dictionary that map script tags to arrays of language tags. (read-only)

    Declaration

    Swift

    var languageMap: [NSObject : AnyObject] { get }

    Objective-C

    @property(readonly, copy) NSDictionary *languageMap

    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.)

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.6 and later.

    See Also

    dominantScript

  • Returns the list of languages for the specified script.

    Declaration

    Swift

    func languagesForScript(_ script: String) -> [AnyObject]?

    Objective-C

    - (NSArray *)languagesForScript:(NSString *)script

    Parameters

    script

    The script.

    Return Value

    An array of strings containing the languages.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.6 and later.

  • Returns the dominant language for the specified script.

    Declaration

    Swift

    func dominantLanguageForScript(_ script: String) -> String

    Objective-C

    - (NSString *)dominantLanguageForScript:(NSString *)script

    Parameters

    script

    The script.

    Return Value

    A string containing the dominant language

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.6 and later.

  • Returns an array containing all the languages appearing in the values of the language map. (read-only)

    Declaration

    Swift

    var allLanguages: [AnyObject] { get }

    Objective-C

    @property(readonly, copy) NSArray *allLanguages

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.6 and later.

  • Returns an array containing all the scripts appearing as keys in the language map. (read-only)

    Declaration

    Swift

    var allScripts: [AnyObject] { get }

    Objective-C

    @property(readonly, copy) NSArray *allScripts

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.6 and later.

  • Returns the first language in the list of languages for the dominant script. (read-only)

    Declaration

    Swift

    var dominantLanguage: String { get }

    Objective-C

    @property(readonly, copy) NSString *dominantLanguage

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.6 and later.