from autocorrect import Speller
spell = Speller('ru')
text = 'Проверкка текста на ашибки.'
print(spell(text))
Проверка текста на ошибки.
import language_tool_python
tool = language_tool_python.LanguageTool('ru-RU')
text = 'Проверкка текста на ашибки.'
matches = tool.check(text)
print(matches)
res = {}
for d in ({'city': 'Moscow', 'manager': 'Igor'},
{'city': 'Kazan', 'manager': 'Valera'},
{'city': 'Moscow', 'manager': 'Olga'},
{'city': 'Kazan', 'manager': 'Natalia'},
{'city': 'Moscow', 'manager': 'Oleg'}):
res.setdefault(d['city'], []).append(d['manager'])
print(res)
If submitting multiple search terms, search has a default AND behavior, rather than an OR behavior. For example, searching for the following phrase returns results only if all of the words are present, in any order.
However, when you use a data property keyword multiple times in a query, there is an OR search across the values you specified. The following phrase returns results that contain either the tag "silver" or the tag "bronze".
tags:silver tags:bronze
use GuzzleHttp\Pool;
use GuzzleHttp\Client;
use GuzzleHttp\Psr7\Request;
$client = new Client();
$requests = function ($total) {
$uri = 'http://127.0.0.1:8126/guzzle-server/perf';
for ($i = 0; $i < $total; $i++) {
yield new Request('GET', $uri);
}
};
$pool = new Pool($client, $requests(100), [
'concurrency' => 5,
'fulfilled' => function ($response, $index) {
// this is delivered each successful response
},
'rejected' => function ($reason, $index) {
// this is delivered each failed request
},
]);
// Initiate the transfers and create a promise
$promise = $pool->promise();
// Force the pool of requests to complete.
$promise->wait();