Initializer

init(_:)

Creates a person name components object from a given string.

Declaration 宣言

init(_ value: String) throws

Parameters パラメータ

value

A string to parse into name components.

Discussion 議論

This initializer uses a combination of locale rules and heuristics to determine the most likely name components for a particular string representation. Parsing name components from a representation created for an existing name components object may not produce equivalent results. 既存の名前構成要素オブジェクトに対して作成されたある表現から名前構成要素を構文解析することは、同等の結果を生成しないかもしれません。

Here are some general rules that describe the name component parsing behavior: ここに名前構成要素構文解析挙動を記述するいくつかの一般的規則があります。

  • Names in Latin script have components delimited by whitespace. ラテン書体での名前は、空白によって区切られる構成要素を持ちます。

  • The format style parses names with a single delimited component into their most likely name component.

  • Names in Latin script with more than two delimited components may include middle components in the givenName, middleName, or familyName name components. 2つより多い区切られた構成要素をもつラテンでの名前は、真ん中の構成要素をgivenNamemiddleName、またはfamilyName名前構成要素において含むかもしれません。

  • The format style may parse names in inverted Latin script into components in a different order than they appear. Inverted names in CJK script won’t typically produce the correct results.

  • Names in Latin script may use a comma to indicate name inversion. ラテン書体での名前は、名前逆転を指し示すためにコンマを使うかもしれません。

  • Names in Latin script have capitalization preserved between string representation and parsed components. ラテン書体での名前は、文字列表現と構文解析された構成要素の間でキャピタライゼーションを保護します。

  • The format style ignores text between parentheses or brackets, as well as extraneous characters in names.

String

Name prefix

Given name

Middle name

Family name

Name suffix

Thomas Clark

Thomas

Clark

Thomas Louis Clark

Thomas

Louis

Clark

Tom Louis Appleseed

Tom Louis

Clark

Thomas L. Appleseed

Thomas

L.

Clark

Dr. Thomas, Esq.

Dr.

Thomas

Esq.

thomas clark

thomas

clark

Clark, Thomas

Thomas

Clark

Clark Thomas

Thomas

Clark

CLARK Thomas

Thomas

CLARK

Thomas (a.k.a. Tom) Clark 🍎

Thomas

Clark

杨振宁

振宁

Jean-Philippe de Zélicourt

Jean-Philippe

de Zélicourt

Max Mustermann

Max

Mustermann

木田泰夫

泰夫

木田

José Ramiro Martín González de Rivera

José

Ramiro

Martín González de Rivera

See Also 参照

Parsing Person Name Components