Skip to content

Commit f99109c

Browse files
committed
[stdlib] NFC: Unicode.Scalar.Properties documentation fixes
1 parent 520c645 commit f99109c

File tree

1 file changed

+28
-34
lines changed

1 file changed

+28
-34
lines changed

stdlib/public/core/UnicodeScalarProperties.swift

Lines changed: 28 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ extension Unicode.Scalar.Properties {
236236
///
237237
/// This property roughly defines the class of "Chinese characters" and does
238238
/// not include characters of other logographic scripts such as Cuneiform or
239-
/// Egyptian Hieroglyphs
239+
/// Egyptian Hieroglyphs.
240240
///
241241
/// This property corresponds to the `Ideographic` property in the
242242
/// [Unicode Standard](http://www.unicode.org/versions/latest/).
@@ -291,8 +291,8 @@ extension Unicode.Scalar.Properties {
291291
/// directs the rendering engine to render them as a connected glyph when it
292292
/// would otherwise render them independently. The zero width joiner is also
293293
/// used to construct complex emoji from sequences of base emoji characters.
294-
/// For example, "family" emoji are created by joining sequences of man,
295-
/// woman, and child emoji with the zero width joiner.
294+
/// For example, the various "family" emoji are encoded as sequences of man,
295+
/// woman, or child emoji that are interleaved with zero width joiners.
296296
///
297297
/// This property corresponds to the `Join_Control` property in the
298298
/// [Unicode Standard](http://www.unicode.org/versions/latest/).
@@ -519,35 +519,35 @@ extension Unicode.Scalar.Properties {
519519
return _hasBinaryProperty(__swift_stdlib_UCHAR_CASE_IGNORABLE)
520520
}
521521

522-
/// A Boolean property indicating whether the scalar is one whose normalized
523-
/// form is not stable under a `toLowercase` mapping.
522+
/// A Boolean property indicating whether the scalar's `lowercaseMapping`
523+
/// differs from the NFD normalized form of the scalar itself.
524524
///
525525
/// This property corresponds to the `Changes_When_Lowercased` property in the
526526
/// [Unicode Standard](http://www.unicode.org/versions/latest/).
527527
public var changesWhenLowercased: Bool {
528528
return _hasBinaryProperty(__swift_stdlib_UCHAR_CHANGES_WHEN_LOWERCASED)
529529
}
530530

531-
/// A Boolean property indicating whether the scalar is one whose normalized
532-
/// form is not stable under a `toUppercase` mapping.
531+
/// A Boolean property indicating whether the scalar's `uppercaseMapping`
532+
/// differs from the NFD normalized form of the scalar itself.
533533
///
534534
/// This property corresponds to the `Changes_When_Uppercased` property in the
535535
/// [Unicode Standard](http://www.unicode.org/versions/latest/).
536536
public var changesWhenUppercased: Bool {
537537
return _hasBinaryProperty(__swift_stdlib_UCHAR_CHANGES_WHEN_UPPERCASED)
538538
}
539539

540-
/// A Boolean property indicating whether the scalar is one whose normalized
541-
/// form is not stable under a `toTitlecase` mapping.
540+
/// A Boolean property indicating whether the scalar's `titlecaseMapping`
541+
/// differs from the NFD normalized form of the scalar itself.
542542
///
543543
/// This property corresponds to the `Changes_When_Titlecased` property in the
544544
/// [Unicode Standard](http://www.unicode.org/versions/latest/).
545545
public var changesWhenTitlecased: Bool {
546546
return _hasBinaryProperty(__swift_stdlib_UCHAR_CHANGES_WHEN_TITLECASED)
547547
}
548548

549-
/// A Boolean property indicating whether the scalar is one whose normalized
550-
/// form is not stable under case folding.
549+
/// A Boolean property indicating whether the scalar is one that is not
550+
/// identical to its case-fold mapping.
551551
///
552552
/// This property corresponds to the `Changes_When_Casefolded` property in the
553553
/// [Unicode Standard](http://www.unicode.org/versions/latest/).
@@ -556,7 +556,7 @@ extension Unicode.Scalar.Properties {
556556
}
557557

558558
/// A Boolean property indicating whether the scalar may change when it
559-
/// undergoes a case mapping.
559+
/// undergoes case mapping.
560560
///
561561
/// For any scalar `s`, it holds by definition that
562562
///
@@ -752,10 +752,8 @@ extension Unicode.Scalar.Properties {
752752
/// WITH DOT ABOVE) becomes two scalars (U+0069 LATIN SMALL LETTER I, U+0307
753753
/// COMBINING DOT ABOVE) when converted to lowercase.
754754
///
755-
/// This function corresponds to the `Lowercase_Mapping` property in the
755+
/// This property corresponds to the `Lowercase_Mapping` property in the
756756
/// [Unicode Standard](http://www.unicode.org/versions/latest/).
757-
///
758-
/// - Returns: The lowercase mapping of the scalar.
759757
public var lowercaseMapping: String {
760758
return _applyMapping(__swift_stdlib_u_strToLower)
761759
}
@@ -768,10 +766,8 @@ extension Unicode.Scalar.Properties {
768766
/// becomes "Fi" (U+0046 LATIN CAPITAL LETTER F, U+0069 LATIN SMALL LETTER I)
769767
/// when converted to titlecase.
770768
///
771-
/// This function corresponds to the `Titlecase_Mapping` property in the
769+
/// This property corresponds to the `Titlecase_Mapping` property in the
772770
/// [Unicode Standard](http://www.unicode.org/versions/latest/).
773-
///
774-
/// - Returns: The titlecase mapping of the scalar.
775771
public var titlecaseMapping: String {
776772
return _applyMapping { ptr, cap, src, len, locale, err in
777773
return __swift_stdlib_u_strToTitle(ptr, cap, src, len, nil, locale, err)
@@ -786,10 +782,8 @@ extension Unicode.Scalar.Properties {
786782
/// SHARP S) becomes "SS" (U+0053 LATIN CAPITAL LETTER S, U+0053 LATIN CAPITAL
787783
/// LETTER S) when converted to uppercase.
788784
///
789-
/// This function corresponds to the `Uppercase_Mapping` property in the
785+
/// This property corresponds to the `Uppercase_Mapping` property in the
790786
/// [Unicode Standard](http://www.unicode.org/versions/latest/).
791-
///
792-
/// - Returns: The uppercase mapping of the scalar.
793787
public var uppercaseMapping: String {
794788
return _applyMapping(__swift_stdlib_u_strToUpper)
795789
}
@@ -1354,14 +1348,14 @@ extension Unicode.Scalar.Properties {
13541348
/// number.
13551349
///
13561350
/// ```
1357-
/// print("X", ("X" as Unicode.Scalar).properties.numericType)
1351+
/// print("X", ("X" as Unicode.Scalar).properties.numericType ?? "nil")
13581352
/// // Prints "X nil"
1359-
/// print("4", ("4" as Unicode.Scalar).properties.numericType)
1360-
/// // Prints "4 Optional(Swift.Unicode.NumericType.decimal)"
1361-
/// print("\u{2463}", ("\u{2463}" as Unicode.Scalar).properties.numericType)
1362-
/// // Prints "④ Optional(Swift.Unicode.NumericType.digit)"
1363-
/// print("\u{2155}", ("\u{2155}" as Unicode.Scalar).properties.numericType)
1364-
/// // Prints "⅕ Optional(Swift.Unicode.NumericType.numeric)"
1353+
/// print("4", ("4" as Unicode.Scalar).properties.numericType ?? "nil")
1354+
/// // Prints "4 decimal"
1355+
/// print("\u{2463}", ("\u{2463}" as Unicode.Scalar).properties.numericType ?? "nil")
1356+
/// // Prints "④ digit"
1357+
/// print("\u{2155}", ("\u{2155}" as Unicode.Scalar).properties.numericType ?? "nil")
1358+
/// // Prints "⅕ numeric"
13651359
/// ```
13661360
///
13671361
/// This property corresponds to the `Numeric_Type` property in the
@@ -1375,20 +1369,20 @@ extension Unicode.Scalar.Properties {
13751369

13761370
/// The numeric value of the scalar.
13771371
///
1378-
/// The value of this property is `nil` for scalars that do not represent a
1372+
/// The value of this property is nil for scalars that do not represent a
13791373
/// number.
13801374
///
13811375
/// The numeric value of a scalar is represented as a `Double` because some
13821376
/// scalars represent fractions:
13831377
///
13841378
/// ```
1385-
/// print("X", ("X" as Unicode.Scalar).properties.numericValue)
1386-
/// // Prints "X nan"
1387-
/// print("4", ("4" as Unicode.Scalar).properties.numericValue)
1379+
/// print("X", ("X" as Unicode.Scalar).properties.numericValue ?? "nil")
1380+
/// // Prints "X nil"
1381+
/// print("4", ("4" as Unicode.Scalar).properties.numericValue ?? "nil")
13881382
/// // Prints "4 4.0"
1389-
/// print("\u{2463}", ("\u{2463}" as Unicode.Scalar).properties.numericValue)
1383+
/// print("\u{2463}", ("\u{2463}" as Unicode.Scalar).properties.numericValue ?? "nil")
13901384
/// // Prints "④ 4.0"
1391-
/// print("\u{2155}", ("\u{2155}" as Unicode.Scalar).properties.numericValue)
1385+
/// print("\u{2155}", ("\u{2155}" as Unicode.Scalar).properties.numericValue ?? "nil")
13921386
/// // Prints "⅕ 0.2"
13931387
/// ```
13941388
///

0 commit comments

Comments
 (0)