Skip to content

Console application for analyzing the frequency of words used in texts on websites

License

Notifications You must be signed in to change notification settings

smysloff/tfa-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Term Frequency Analyzer (CLI-версия)

It is a terminal application to analyse words' frequency which are used in texts on websites. It is possible to download a page or several pages, if they are recorded in a text file. The result of the analysis can be found in terminal or in csv file which depends on given set of preconditions.

Requirements

Programme installation

Programme needs language libraries, thus there are two steps in the installation process:

1) Programme installation

  • using GIT

git clone [email protected]:smysloff/tfc-cli.git
  • manually

Download zip-archive, then extract files in a preferable folder.

2) Language libraries installation

It is possible to use Russian and English dictionaries which can be installed in two ways:

It is obligatory to place binary files of dictionaries in the folder: src/Libs/phpmorphy/dicts/

Usage

Open the terminal in the project's root and launch the programme using file tfa.php and PHP-interpritator. Do not forget to provide an argument - address of the website or the file name where the list of websites' addresses put.

Examples

an address of the website as an argument:

php tfa.php example.com

a file with the list of websites' addresses as an argument:

php tfa.php in/urls.txt

If URL is provided as an argument, it is possible to specify the file where the result of analysis will be presented:

php tfa.php -i example.com -o test-out/output.csv

If file name is provided as an argument, it is possible to specify the folder where the result of analysis will be presented, in this case there will be a report for every website listed in the file:

php tfa.php in/urls.txt -o test-out

Use an argument -h to get information about programme's work

php tfa.php -h

Liсense

GNU General Public License v3.0

Term Frequency Analyzer (CLI-версия):

Консольная программа для анализа частотности слов, использованных в текстах на сайтах. Для анализа можно передавать как одну страницу, так и список страниц, записанных в текстовый файл. Результат анализа выводится либо в терминал, либо в csv-файл, в зависимости от заданных условий.

Требования

Установка

Для работы программы требуется наличие языковых библиотек. Поэтому процесс установки можно разделить на два этапа:

1) Установка самой программы

  • При помощи GIT

git clone [email protected]:smysloff/tfc-cli.git
  • Или в ручную

Скачайте zip-архив и распакуйте в удобную для вас папку.

2) Установка языковых библиотек

Программа работает с русскими и английскими словарями, получить которые можно двумя способами:

Разместить бинарные файлы словарей необходимо в директории: src/Libs/phpmorphy/dicts/

Использование

Для запуска программы следует открыть терминал в корне проекта и запустить при помощи PHP-интерпретатора файл tfa.php, передав в качестве аргумента адрес страницы сайта или название файла со списком адресов.

Примеры

Передать на вход URL:

php tfa.php example.com

Передать на вход файл со списком URL

php tfa.php in/urls.txt

Если в качестве входного параметра указан URL, то можно указать в какой файл должен выводиться результат анализа

php tfa.php -i example.com -o test-out/output.csv

Если в качестве входного параметра указан файл, то можно указать директорию для выходных данных, в этом случае отчет по каждой странице будет сохранен в отдельном файле

php tfa.php in/urls.txt -o test-out

Для справки по работе программы, нужно указать аргумент -h

php tfa.php -h

Лицензия

GNU General Public License v3.0

About

Console application for analyzing the frequency of words used in texts on websites

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages