acidf0x/php-korean-handler
Composer 安装命令:
composer require acidf0x/php-korean-handler
包简介
PHP Korean Handler - Hangul Separator
README 文档
README
한글 자모 분리 라이브러리 (초성, 중성, 종성)
Installation
install using composer:
composer require acidf0x/php-korean-handler
Usage
조회시 반환 값은 U+3130와 U+318F 사이의 Hangul Compatibility Jamo가 반환 됩니다.
use AcidF0x\KoreanHandler\Seperator; $separator = new Seperator(); $result = $separator->separate("수상하게 돈이 많은"); print_r($result->getSplitList()); // ["ㅅ","ㅜ","ㅅ","ㅏ","ㅇ","ㅎ","ㅏ","ㄱ","ㅔ","ㄷ","ㅗ","ㄴ","ㅇ","ㅣ","ㅁ","ㅏ","ㄶ","ㅇ","ㅡ","ㄴ"] print_r($result->getChoseongList()); // ["ㅅ", "ㅅ", "ㅎ", "ㄱ", "ㄷ", "ㅇ", "ㅁ", "ㅇ"] print_r($result->getJungseongList()); // ["ㅜ", "ㅏ", "ㅏ", "ㅔ", "ㅗ", "ㅣ", "ㅏ", "ㅡ"] print_r($result->getJongseongList()); // ["ㅇ","ㄴ","ㄶ","ㄴ"]
separate 메서드의 리턴 값은 ArrayAccess, Iterator 인터페이스를 구현하였으므로
각 결과에 대해 Array처럼 접근 하여 사용이 가능합니다
$result = $this->separator->separate("황소"); $result[0]->getChoseong(); // ㅎ $result[0]->getJungseong(); // ㅘ $result[0]->getJongseong(); // ㅇ $result[1]->getChoseong(); // ㅅ $result[1]->getJungseong(); // ㅗ $result[1]->getJongseong(); // null $result[0]->getSplit(); // ["ㅎ", "ㅘ", "ㅇ"] foreach ($result as $character) { $character->getChoseong(); }
acidf0x/php-korean-handler 适用场景与选型建议
acidf0x/php-korean-handler 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 120 次下载、GitHub Stars 达 3, 最近一次更新时间为 2018 年 08 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 acidf0x/php-korean-handler 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 acidf0x/php-korean-handler 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 120
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-08-14