{"id":22962391,"url":"https://github.com/zonble/chinesecomparator","last_synced_at":"2025-09-01T01:34:28.924Z","repository":{"id":66712622,"uuid":"462173660","full_name":"zonble/ChineseComparator","owner":"zonble","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-12T16:06:01.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-12T17:32:49.390Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zonble.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-22T06:49:50.000Z","updated_at":"2025-08-12T16:06:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"a777003a-05cb-4750-8589-517c9348fb2d","html_url":"https://github.com/zonble/ChineseComparator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zonble/ChineseComparator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zonble%2FChineseComparator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zonble%2FChineseComparator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zonble%2FChineseComparator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zonble%2FChineseComparator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zonble","download_url":"https://codeload.github.com/zonble/ChineseComparator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zonble%2FChineseComparator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273064451,"owners_count":25039261,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-31T02:00:09.071Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-14T19:16:40.185Z","updated_at":"2025-09-01T01:34:28.918Z","avatar_url":"https://github.com/zonble.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ChineseComparator\n\nA Swift package for comparing and sorting Chinese text using various collation methods.\n\n## Copyright\n\nCopyright © 2024 zonble. All rights reserved.\n\n## Installation\n\n### Swift Package Manager\n\nYou can add ChineseComparator to your project using Swift Package Manager. In Xcode:\n\n1. Go to File → Add Package Dependencies...\n2. Enter the repository URL: `https://github.com/zonble/ChineseComparator`\n3. Click Add Package\n\nOr add it to your `Package.swift` file:\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/zonble/ChineseComparator\", from: \"1.0.0\")\n]\n```\n\n## Usage\n\nChineseComparator provides two main ways to compare Chinese text:\n\n### 1. String Extension for Comparison\n\n```swift\nimport ChineseComparator\n\nlet string1 = \"一\"\nlet string2 = \"二\"\n\n// Compare using Pinyin method\nlet result = string1.compare(string2, options: [], range: nil, method: .pinyin)\n```\n\n### 2. SortComparator for Sorting Arrays (iOS 15.0+, macOS 12.0+)\n\n```swift\nimport ChineseComparator\n\nlet chineseNumbers = [\"一\", \"二\", \"三\", \"四\"]\n\n// Sort using different methods\nlet sortedByPinyin = chineseNumbers.sorted(using: ChineseSortComparator(method: .pinyin))\nlet sortedByStroke = chineseNumbers.sorted(using: ChineseSortComparator(method: .stroke))\nlet sortedByGB2312 = chineseNumbers.sorted(using: ChineseSortComparator(method: .gb2313))\n```\n\n## Available Comparison Methods\n\nChineseComparator supports five different Chinese collation methods:\n\n- **`.stroke`** - Sort by stroke count\n- **`.pinyin`** - Sort by Pinyin pronunciation\n- **`.big5`** - Sort using Big5 encoding order\n- **`.gb2313`** - Sort using GB2312 encoding order  \n- **`.unihan`** - Sort using Unicode Han database order\n\n## Platform Support\n\n- iOS 15.0+\n- macOS 12.0+\n- tvOS 15.0+\n- watchOS 8.0+\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzonble%2Fchinesecomparator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzonble%2Fchinesecomparator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzonble%2Fchinesecomparator/lists"}