Download??????? ???????????? ???????????
???? ? ?????? ?????????? ??????? ??? ?? Ascoos OS ??????? ?? ??????????? ???? ??????????? ?? ???????? ???????????, ????????? ?? ??????, ??? ???????????? ??? ????? ??? ?????????? ???? ??? ???????????. ?? ?????????? ?????? ??????????? ??? ??? ?????????? (?.?., https://example.com), ????????? ?? ??????, ??????? ??????? NLP, ??? ?????????? ??????? ??????????????? ?? ????? CPU.
??????
???? ?? ?????????? ??????? ??? ?????????? ????????? ????????? ??? Ascoos OS:
- TWebsiteHandler: ?????? ??? ????????? ?? HTML ??????????? ??? ???????????.
- TLanguageHandler: ????????? ?? ?????? ??? ???????? ?? ???? ?????????????? ?????? ????????? ??? ??????????.
- TLinguisticAnalysisHandler: ??????? ???????? ??????? ?? ???? ??? ??????????? ??????.
- TCoreSystemHandler: ???????????? ??? ????? ??? ?????????? ??? ?????????? ????? ????? CPU.
- TFilesHandler: ????????????? ??????????? ???????, ???? ? ?????????? ??? ???????? ????????.
????
? ?????? ?????????? ??????????? ?? ??? ???? ?????? PHP:
- website_linguistic_analysis.php: ??????? ?? ??? ???????? ??? ???????? ????????????, ????????? ???????, ???????? ???????, ??? ????????????? ??????????.
?????????????
-
??????????? ??? ?? Ascoos OS ????? ????????????? (????? ?? ????? repository). ?? ?????????????? ??
ASCOOS Web Extended Studio (AWES) 26, ?? Ascoos OS ????? ????????????????.
-
?????????? ??? ???????????? ???? ????????? NLP (?.?., MySQL) ??? ?? `TLinguisticAnalysisHandler`. ? ?????????? ??? ????? ????????? ???????? ???????? ???? ??? global ?????? `$conf['db']['mysqli']` ???? ??? ???????? ??? Ascoos OS.
-
?????????? ???????? ????? ???????? ??? ????????? ??? ?? `$AOS_LOGS_PATH` (logs) ??? `$AOS_TMP_DATA_PATH/reports/nlp/` (?????? ??????). ????? ?? ????????? ?????????????? ???????? ??? ?? Ascoos OS.
-
?? ?????? ??????????? `alphabets.json` ??? `wordlist.json` ?????? ?? ????? ????????? ??? `$AOS_CONFIG_PATH/`.
-
?? ?????? ?????????????? `Murecho-Regular.ttf` ????? ???????????????? ?? ?? Ascoos OS ??? `$AOS_FONTS_PATH/Murecho/Murecho-Regular.ttf`. ????????? ?????????????? ??????? ?? ?????????? ???????? ???? ??? ???????????? `LibIn` ?? ????? ?????? Ajax.
-
?? global ?????????? (`$conf`, `$AOS_LOGS_PATH`, `$AOS_TMP_DATA_PATH`, `$AOS_CONFIG_PATH`) ????????? ???????? ??? ?? Ascoos OS ???? ??? ????????.
-
? ?????????? phpBCL8 ????? ???????????????? ??? ?????????? ???????? ??? ?? Ascoos OS ????? ?? ????? Composer.
??????????
-
??????????? ??? ?? global ?????????? (`$conf`, `$AOS_LOGS_PATH`, `$AOS_TMP_DATA_PATH`, `$AOS_CONFIG_PATH`) ????? ??????????, ???? ????????? ??? ?? Ascoos OS ???? ??? ????????.
-
???????????? ??? ????????? `$url` ??? script ??? ?? ?????????? ??? ????????? ?????????? (????????????? ????? `https://example.com`).
-
????????? ?? script ???? ???? web server, ?.?., `https://localhost/aos/examples/case-studies/websites/linguistic_analysis/website_linguistic_analysis.php`.
?????????? ??????
use ASCOOS\OS\Kernel\{
Systems\TCoreSystemHandler,
Websites\TWebsiteHandler,
Languages\TLanguageHandler,
AI\TLinguisticAnalysisHandler,
Files\TFilesHandler
};
global $conf, $AOS_LOGS_PATH, $AOS_TMP_DATA_PATH, $AOS_CONFIG_PATH;
// ???????????? ?????????
$properties = [
'logs' => [
'useLogger' => $conf['logs']['useLogger'] ?? true,
'dir' => $conf['logs']['dir'] ?? $AOS_LOGS_PATH,
'file' => 'sports_analysis.log'
],
'file' => [
'baseDir' => $AOS_TMP_DATA_PATH . 'reports/nlp/',
'quotaSize' => 1000000000
],
'nlp' => [
'host' => $conf['db']['mysqli']['host'] ?? 'localhost',
'user' => $conf['db']['mysqli']['user'] ?? 'root',
'password' => $conf['db']['mysqli']['pass'] ?? 'root',
'dbname' => $conf['db']['mysqli']['dbname'] ?? 'linguistics'
]
];
// ???????????? ??????? ASCOOS
$system = new TCoreSystemHandler(['cpu_percent_warn' => 80]);
$website = new TWebsiteHandler();
$language = new TLanguageHandler([], [
'alphabetsPath' => $AOS_CONFIG_PATH . '/alphabets.json',
'wordListPath' => $AOS_CONFIG_PATH . '/wordlist.json'
]);
$nlp = new TLinguisticAnalysisHandler([], $properties['nlp']);
??????????? ??????
?? script ??????? ??? ??????? JSON (report.json) ?? ???????????? ??? ??? ??????????, ??? ??????????? ??????, ??? ????? CPU, ??? ??? ???????? ???????. ?????????? ?????? JSON: {
"url": "https://example.com",
"language": "el",
"cpu_load": 45.3,
"analysis": {
"sentiment": "????????",
"keywords": ["??????????", "??????"]
}
}
?????
??????????
?????? ?? ???????????? ?? ???? ?? ?????? ??????????; ????? fork ?? repository, ???????????? ? ????????? ???? ??????????? ??? website_linguistic_analysis.php, ??? ????????? pull request. ????? ?? CONTRIBUTING.md ??? ???????.
?????
???? ? ?????? ?????????? ?????????? ??? ??? Ascoos General License (AGL). ????? ?? LICENSE.
|