darrynten/after-the-deadline-php

本软件包最新版本(v0.9.1)没有可用的许可证信息。

PHP After The Deadline 客户端。

v0.9.1 2017-03-10 06:50 UTC

This package is auto-updated.

Last update: 2024-09-09 10:26:50 UTC


README

Travis Build Status StyleCI Status codecov Packagist Version MIT License

一个非官方的、完全单元测试的 After The Deadline PHP 客户端。

PHP 7.0+

使用方法

密钥

来自 http://www.afterthedeadline.com/api.slp

我们曾要求用户注册以获取 API 密钥。现在我们不再这样做,但应用程序仍然需要提交 API 密钥。API 密钥既用作同步锁定点(例如,一次只处理一个请求/密钥)又用于启用服务器端结果和会话信息的缓存。这使得后续请求相同密钥的速度更快。

要生成 API 密钥,请考虑使用一个简短的字符串来标识您的应用程序,后面跟一个对用户或 AtD 安装唯一的哈希值,例如网站 URL。

示例

包含

composer require darrynten/after-the-deadline-php

使用

use DarrynTen\AfterTheDeadlinePhp\AfterTheDeadline;

// Config options
$config = [
  'key' => 'my-generated-key',  // At the very least
  'text' => $text,              // You can pass text in
  'format' => 'html'            // You can also specify (plain is default)
];

// Make a translator
$checker = new AfterTheDeadline($config);

// Set text and type (html or plain)
$checker->setText($text);
$language->setFormat('plain');

// Enable / disable caching
$language->setCache(false);

// Get suggestions
$checker->checkDocument(); // does both spelling and grammar
$checker->checkGrammar();  // only does grammar

// Get stats on the text
$checker->stats();

// Get an explanation on the grammar of an incorrect type
// Not yet implemented
$checker->getInfo($term);  // e.g. 'to be' should be re-written in active

有关这些选项及其使用方法的更多信息,请参阅AtD API 文档

优秀

  • 获取信息

致谢

  • 打开一个 PR 并在这里添加您的名字 :)