apto1/translate-scrapper
最新稳定版本:1.0.0
Composer 安装命令:
composer require apto1/translate-scrapper
包简介
Create directories and search based on terms on wp pagesd
README 文档
README
To create the dictionary files ex.:
/** * The urls array of the content to be crawled * pageId=>['en'=>'url','gr'=>'url'] */ const URLS = [ 13 => [ 'en' => 'https://herema.gr/who-we-are/our-mandate/', 'gr' => 'https://herema.gr/el/who-we-are/our-mandate/', ], 14 => [ 'en' => 'https://herema.gr/who-we-are/our-transformation/', 'gr' => 'https://herema.gr/el/who-we-are/our-transformation/', ], ]; /** * Just initialize the class and everything will be done automatically */ $scrapper = new Scrapper(URLS); /** * There are some available methods for debugging */ //The URLS array $scrapper->getUrls(); //The dictionary array $scrapper->getFiles(); //Performance timings for curl,parsing and writing $scrapper->getPerformance(); //The scrapped sanitzed content $scrapper->getScrappedContent(); //The original content $scrapper->getUrlContent();
To search the dictionary files ex.:
/** * Create a new instance of the Search class * by passing the language * PS. Leave blank contructor for en languange */ $dictionary = new Dictionary('gr'); /** * Search for a word using the ->search() method */ $dictionary->search('Με πυξίδα την πεποίθηση ότι η εταιρεία'); /** * Retrieve the results using the ->getResults() method */ $res = $dictionary->getResult(); /** * There are some available methods for debugging */ //Performance timings for parsing and searching $dictionary->getPerformance(); //The dictionary array $dictionary->getDictionary()
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-11-15