<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSMorphology",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSMorphology"
  },
  "title" : "NSMorphology"
}
-->

# NSMorphology

A description of the grammatical properties of a string.

```
@interface NSMorphology : NSObject
```

## Overview

Use a morphology with an [`NSInflectionRule`](/documentation/Foundation/NSInflectionRule) to specify how to interpret a specific word when inflecting an [`NSAttributedString`](/documentation/Foundation/NSAttributedString). This affects grammatical agreement with traits like number and gender, as well as declaring the word’s part of speech.

The [`NSMorphology`](/documentation/Foundation/NSMorphology) type’s design is language-independent; the concepts it can specify encompass the spectrum of what languages can do. Even for languages that don’t have one or more of those properties benefit the system as hints to make appropriate choices even when an exact inflection isn’t possible. Examples of properties absent from languages include Spanish’s lack of a grammatical gender of neuter, or the nonexistence of a paucal (plural few) pronoun in English.

## Topics

### Accessing the User’s Morphology

[`userMorphology`](/documentation/Foundation/NSMorphology/userMorphology)

The addressing preferences of the current user.

### Accessing Grammatical Properties

[`unspecified`](/documentation/Foundation/NSMorphology/unspecified)

A Boolean value that indicates whether this instance specifies no particular grammar.

[`grammaticalGender`](/documentation/Foundation/NSMorphology/grammaticalGender)

The grammatical gender used for inflecting strings with this morphology.

[`NSGrammaticalGender`](/documentation/Foundation/NSGrammaticalGender)

A representation of grammatical gender, used for inflecting strings.

[`number`](/documentation/Foundation/NSMorphology/number)

The grammatical number used for inflecting strings with this morphology.

[`NSGrammaticalNumber`](/documentation/Foundation/NSGrammaticalNumber)

A representation of grammatical number, used for inflecting strings.

[`partOfSpeech`](/documentation/Foundation/NSMorphology/partOfSpeech)

The grammatical part of speech used for inflecting strings with this morphology.

[`NSGrammaticalPartOfSpeech`](/documentation/Foundation/NSGrammaticalPartOfSpeech)

A representation of grammatical parts of speech, used for inflecting strings.

### Accessing Per-Language Features

[`setCustomPronoun:forLanguage:error:`](/documentation/Foundation/NSMorphology/setCustomPronoun:forLanguage:error:)

Sets a custom pronoun behavior for this morphology to apply to the given language.

[`customPronounForLanguage:`](/documentation/Foundation/NSMorphology/customPronounForLanguage:)

Returns any custom pronoun behavior this morphology applies to the given language.

[`NSMorphologyCustomPronoun`](/documentation/Foundation/NSMorphologyCustomPronoun)

A custom pronoun behavior for use in a specific langauge.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)