---
title: Morphology
framework: foundation
role: symbol
role_heading: Structure
path: foundation/morphology
---

# Morphology

A description of the grammatical properties of a string.

## Declaration

```swift
struct Morphology
```

## Overview

Overview Use a morphology with an InflectionRule to specify how to interpret a specific word when inflecting an AttributedString. This affects grammatical agreement with traits like number and gender, as well as declaring the word’s part of speech. The Morphology 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

### Creating a Morphology Instance

- [init()](foundation/morphology/init().md)

### Accessing the User’s Morphology

- [user](foundation/morphology/user.md)

### Accessing Grammatical Properties

- [isUnspecified](foundation/morphology/isunspecified.md)
- [grammaticalGender](foundation/morphology/grammaticalgender-swift.property.md)
- [Morphology.GrammaticalGender](foundation/morphology/grammaticalgender-swift.enum.md)
- [number](foundation/morphology/number.md)
- [Morphology.GrammaticalNumber](foundation/morphology/grammaticalnumber.md)
- [partOfSpeech](foundation/morphology/partofspeech-swift.property.md)
- [Morphology.PartOfSpeech](foundation/morphology/partofspeech-swift.enum.md)

### Accessing Per-Language Features

- [setCustomPronoun(_:forLanguage:)](foundation/morphology/setcustompronoun(_:forlanguage:).md)
- [customPronoun(forLanguage:)](foundation/morphology/custompronoun(forlanguage:).md)
- [Morphology.CustomPronoun](foundation/morphology/custompronoun.md)

### Structures

- [Morphology.Pronoun](foundation/morphology/pronoun.md)

### Instance Properties

- [definiteness](foundation/morphology/definiteness-swift.property.md)
- [determination](foundation/morphology/determination-swift.property.md)
- [grammaticalCase](foundation/morphology/grammaticalcase-swift.property.md)
- [grammaticalPerson](foundation/morphology/grammaticalperson-swift.property.md)
- [pronounType](foundation/morphology/pronountype-swift.property.md)

### Enumerations

- [Morphology.Definiteness](foundation/morphology/definiteness-swift.enum.md)
- [Morphology.Determination](foundation/morphology/determination-swift.enum.md)
- [Morphology.GrammaticalCase](foundation/morphology/grammaticalcase-swift.enum.md)
- [Morphology.GrammaticalPerson](foundation/morphology/grammaticalperson-swift.enum.md)
- [Morphology.PronounType](foundation/morphology/pronountype-swift.enum.md)

## Relationships

### Conforms To

- [Copyable](swift/copyable.md)
- [Decodable](swift/decodable.md)
- [Encodable](swift/encodable.md)
- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [Hashable](swift/hashable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Automatic grammar agreement

- [InflectionRule](foundation/inflectionrule.md)
- [TermOfAddress](foundation/termofaddress.md)
- [InflectionConcept](foundation/inflectionconcept.md)
- [Morphology.Pronoun](foundation/morphology/pronoun.md)
