typearea / hyphenator
Hyphenator 是 Mathias Nater 的 JavaScript Hyphenator.js 的 PHP 版本,并支持缓存,这是 github.com/webrocker/hyphenator 的一个错误修复分支。
dev-master
2016-05-17 19:33 UTC
Requires
- php: >=5.3.0
This package is not auto-updated.
Last update: 2024-09-28 19:15:11 UTC
README
Hyphenator 是一个面向对象且支持缓存的 phpHyphenator(《http://phphyphenator.yellowgreen.de/》)版本,而 phpHyphenator 是 Mathias Nater 的 JavaScript Hyphenator(《http://code.google.com/p/hyphenator/》)的 PHP 版本。
安装
只需将 typearea/hyphenator
添加到您的 composer.json
文件中,然后运行 composer.phar update
以将 Hyphenator 添加到您的项目中。
使用方法
参考 sample.php
性能
考虑使用 MemcachedCache
或 ApcCache
来提高性能。当存在缓存时,Hyphenator 将缓存对 hyphenate()
方法的调用,并且仅在需要时才翻译文本。Hyphenator 还会缓存语言模式在包含之后的转换,这是一个计算密集型的操作。