One Logo Pool Ball
Foundation · IOS API REFERENCE

Morphology

struct · iOS 15.0+ · SDK 27.1

struct Morphology

A description of the grammatical properties of a string. 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.

Members (21)

get · iOS 17.0+

pronounType

TypeScript
get pronounType(): (Morphology_PronounType) | null
Swift declaration
var pronounType: Morphology.PronounType?
set · iOS 17.0+

pronounType

TypeScript
set pronounType(value: (Morphology_PronounType) | null)
Swift declaration
var pronounType: Morphology.PronounType?
get · iOS 17.0+

definiteness

TypeScript
get definiteness(): (Morphology_Definiteness) | null
Swift declaration
var definiteness: Morphology.Definiteness?
set · iOS 17.0+

definiteness

TypeScript
set definiteness(value: (Morphology_Definiteness) | null)
Swift declaration
var definiteness: Morphology.Definiteness?
get · iOS 15.0+

partOfSpeech

TypeScript
get partOfSpeech(): (Morphology_PartOfSpeech) | null
Swift declaration
var partOfSpeech: Morphology.PartOfSpeech?

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

set · iOS 15.0+

partOfSpeech

TypeScript
set partOfSpeech(value: (Morphology_PartOfSpeech) | null)
Swift declaration
var partOfSpeech: Morphology.PartOfSpeech?

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

method · iOS 15.0+ · Deprecated in iOS 17.0

customPronoun

TypeScript
customPronoun(language: string): (Morphology_CustomPronoun) | null
Swift declaration
func customPronoun(forLanguage language: String) -> Morphology.CustomPronoun?

Returns any custom pronoun behavior this morphology applies to the given language. - Parameter language: The language for which to retrieve custom pronoun behavior. - Returns: A ``CustomPronoun`` instance, or `nil` if no custom pronoun behavior is set for the given language.

get · iOS 17.0+

determination

TypeScript
get determination(): (Morphology_Determination) | null
Swift declaration
var determination: Morphology.Determination?
set · iOS 17.0+

determination

TypeScript
set determination(value: (Morphology_Determination) | null)
Swift declaration
var determination: Morphology.Determination?
get · iOS 15.0+

isUnspecified

TypeScript
get isUnspecified(): boolean
Swift declaration
var isUnspecified: Bool { get }

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

get · iOS 17.0+

grammaticalCase

TypeScript
get grammaticalCase(): (Morphology_GrammaticalCase) | null
Swift declaration
var grammaticalCase: Morphology.GrammaticalCase?
set · iOS 17.0+

grammaticalCase

TypeScript
set grammaticalCase(value: (Morphology_GrammaticalCase) | null)
Swift declaration
var grammaticalCase: Morphology.GrammaticalCase?
method · iOS 15.0+ · Deprecated in iOS 17.0

setCustomPronoun

TypeScript
setCustomPronoun(pronoun: (Morphology_CustomPronoun) | null, language: string): void
Swift declaration
mutating func setCustomPronoun(_ pronoun: Morphology.CustomPronoun?, forLanguage language: String) throws

Sets a custom pronoun behavior for this morphology to apply to the given language. - Parameters: - pronoun: The custom pronoun behavior to set, or `nil` to remove any existing custom pronoun behavior. - language: The language for which to set the custom pronoun behavior.

get · iOS 15.0+

grammaticalGender

TypeScript
get grammaticalGender(): (Morphology_GrammaticalGender) | null
Swift declaration
var grammaticalGender: Morphology.GrammaticalGender?

The grammatical gender used for inflecting strings with this morphology.

set · iOS 15.0+

grammaticalGender

TypeScript
set grammaticalGender(value: (Morphology_GrammaticalGender) | null)
Swift declaration
var grammaticalGender: Morphology.GrammaticalGender?

The grammatical gender used for inflecting strings with this morphology.

get · iOS 17.0+

grammaticalPerson

TypeScript
get grammaticalPerson(): (Morphology_GrammaticalPerson) | null
Swift declaration
var grammaticalPerson: Morphology.GrammaticalPerson?
set · iOS 17.0+

grammaticalPerson

TypeScript
set grammaticalPerson(value: (Morphology_GrammaticalPerson) | null)
Swift declaration
var grammaticalPerson: Morphology.GrammaticalPerson?
get · iOS 15.0+

user

TypeScript
static get user(): Morphology
Swift declaration
static let user: Morphology

The addressing preferences of the current user.

get · iOS 15.0+

number

TypeScript
get number(): (Morphology_GrammaticalNumber) | null
Swift declaration
var number: Morphology.GrammaticalNumber?

The grammatical number used for inflecting strings with this morphology.

set · iOS 15.0+

number

TypeScript
set number(value: (Morphology_GrammaticalNumber) | null)
Swift declaration
var number: Morphology.GrammaticalNumber?

The grammatical number used for inflecting strings with this morphology.

init · iOS 15.0+

init

TypeScript
static init(): Morphology
Swift declaration
init()

Creates an empty morphology instance.

Skipped declarations

No declarations were skipped in this snapshot.

All Foundation types →