From 0ae84286508891d39920caa2b3c5c7344e2dc642 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=A0=E5=90=8D=E5=86=99=E6=89=8B?= Date: Thu, 2 Apr 2020 17:49:18 +0800 Subject: [PATCH] Create README.md --- README.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..97fdd4d --- /dev/null +++ b/README.md @@ -0,0 +1,38 @@ +# LatinizeUrl +## 安装 +将文件放入extensions/LatinizeUrl +添加 +```php +wfLoadExtension('LatinizeUrl'); +``` +到LocalSettings.php + +## 配置 +### 使用PHP内置的解析器(较慢) +```php +$wgLatinizeUrlConfig['parser'] = 'inner'; +``` +开启分词功能 +```php +$wgLatinizeUrlConfig['cutWord'] = true; +``` +开启分词后会很慢,建议使用daemon解析 + +### 使用daemon api解析 +项目地址:[Isekai-LatinizeUrl-Backend](https://github.com/Isekai-Project/Isekai-LatinizeUrl-Backend) +```php +$wgLatinizeUrlConfig['parser'] = 'api'; +$wgLatinizeUrlConfig['url'] = '指向daemon的url,默认的path是网址:端口/asciiurl/hanzi2pinyin'; +$wgLatinizeUrlConfig['fallback'] = false; +``` +也可以配置在daemon离线时自动退回php解析 +```php +$wgLatinizeUrlConfig['fallback'] = 'inner'; +``` +另:虚拟主机可以使用异世界百科的开放api +``` +https://static-www.isekai.cn:8082/api/toolkit/asciiurl/hanzi2pinyin +或 +http://static-www.isekai.cn:8081/api/toolkit/asciiurl/hanzi2pinyin +``` +不保证稳定性,建议自建daemon \ No newline at end of file