---
title: NSOrthography
framework: foundation
role: symbol
role_heading: Class
path: foundation/nsorthography
---

# NSOrthography

A description of the linguistic content of natural language text, typically used for spelling and grammar checking.

## Declaration

```swift
class NSOrthography
```

## Overview

Overview Use NSOrthography objects to describe the linguistic content of a piece of text, including which scripts the text contains, a dominant language (and possibly other languages) for each script, and a dominant script and language for the text as a whole. Scripts are uniformly described by four-letter ISO 15924 script codes, such as "Latn", "Grek", and "Cyrl". The supertags "Jpan" and "Kore" are typically used for Japanese and Korean text, and "Hans" and "Hant" are typically used for Chinese text. The tag "Zyyy" is used if a specific script cannot be identified. See Internationalization and Localization Guide for more information. Languages are uniformly described by BCP-47 tags (preferably in canonical form). The tag "und" is used if a specific language cannot be determined. You typically work with orthography objects returned from methods and properties for classes like NSLinguisticTagger and NSSpellChecker. Subclassing Notes Subclasses must override the dominantScript and languageMap properties. These properties are set using init(dominantScript:languageMap:) or orthographyWithDominantScript:languageMap: in Objective-C.

## Topics

### Creating Orthography Objects

- [defaultOrthography(forLanguage:)](foundation/nsorthography/defaultorthography(forlanguage:).md)
- [init(dominantScript:languageMap:)](foundation/nsorthography/init(dominantscript:languagemap:).md)

### Determining Correspondences Between Languages and Scripts

- [languageMap](foundation/nsorthography/languagemap.md)
- [dominantLanguage](foundation/nsorthography/dominantlanguage.md)
- [dominantScript](foundation/nsorthography/dominantscript.md)
- [dominantLanguage(forScript:)](foundation/nsorthography/dominantlanguage(forscript:).md)
- [languages(forScript:)](foundation/nsorthography/languages(forscript:).md)
- [allScripts](foundation/nsorthography/allscripts.md)
- [allLanguages](foundation/nsorthography/alllanguages.md)

### Initializers

- [init(coder:)](foundation/nsorthography/init(coder:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)

## See Also

### Localization

- [Locale](foundation/locale.md)
- [NSLocalizedString(_:tableName:bundle:value:comment:)](foundation/nslocalizedstring(_:tablename:bundle:value:comment:).md)
- [LocalizedStringResource](foundation/localizedstringresource.md)
- [CustomLocalizedStringResourceConvertible](foundation/customlocalizedstringresourceconvertible.md)
- [URLResource](foundation/urlresource.md)
