79587455

Date: 2025-04-22 21:21:33
Score: 2
Natty:
Report link

Thank you, this is brilliant and just what I needed for a hieroglyphs app (Glyph Quiz). I use slightly different IPA phonetics

extension StringProtocol {
    // credit: https://stackoverflow.com/questions/75253242/customized-sort-order-in-swift
    var glyphEncoding: [Int] { map { Dictionary(uniqueKeysWithValues: "ꜣyꞽꜥwbpfmnrhḥḫẖszšḳkgtṯdḏ"
                                                .enumerated()
                                                .map { (key: $0.element, value: $0.offset) } )[$0] ?? -1 } }
    // Usage: phoneticStrings.sorted { $0.glyphEncoding.lexicographicallyPrecedes($1.glyphEncoding) }
}

(needs an IPA font like CharisSIL installed)

Reasons:
  • Blacklisted phrase (0.5): Thank you
  • Blacklisted phrase (0.5): I need
  • Blacklisted phrase (1): stackoverflow
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Mike F