代码拉取完成,页面将自动刷新
<?php
include_once "util.php";
include_once "result/alias.php";
include_once "result/department.php";
include_once "result/symptons.php";
include_once "result/totalSympton.php";
/**
* @var array $alias
* @var array $department
* @var array $symptons
* @var array $totalSympton
*/
//科室
$result = [];
foreach ($department as $diseaseName => $departments) {
foreach ($departments as $name) {
if (array_search($name, $result) === false) $result[] = $name;
}
}
$fp = fopen("exported/科室.txt", "w");
fwrite($fp, "名称\n");
foreach ($result as $name) {
fwrite($fp, $name . "\n");
}
fclose($fp);
//疾病
$fp = fopen("exported/疾病.txt", "w");
fwrite($fp, "名称\n");
foreach (array_keys($alias) as $diseaseName) {
fwrite($fp, $diseaseName . "\n");
}
fclose($fp);
//症状
$fp = fopen("exported/症状.txt", "w");
fwrite($fp, "名称\n");
foreach ($totalSympton as $sympton) {
fwrite($fp, $sympton . "\n");
}
fclose($fp);
//症状到疾病
$fp = fopen("exported/疾病相关症状.csv", "w");
fwrite($fp, "名称1,关系,名称2\n");
foreach ($symptons as $disease => $targets) {
foreach ($targets as $sympton) {
fwrite($fp, "{$disease},疾病相关症状,{$sympton}" . "\n");
}
}
fclose($fp);
//疾病到科室
$fp = fopen("exported/疾病相关科室.csv", "w");
fwrite($fp, "名称1,关系,名称2\n");
foreach ($department as $disease => $targets) {
foreach ($targets as $target) {
fwrite($fp, "{$disease},疾病相关科室,{$target}" . "\n");
}
}
fclose($fp);
//同义词
$fp = fopen("exported/同义词.csv", "w");
fwrite($fp, "名称1,关系,名称2\n");
foreach ($alias as $disease => $targets) {
foreach ($targets as $target) {
if ($target) fwrite($fp, "{$disease},同义词,{$target}" . "\n");
}
}
fclose($fp);
//Web Data
//疾病
dumpVariableToFile(array_keys($alias), "webData/diseases.php", "diseases");
//症状
dumpVariableToFile($totalSympton, "webData/symptons.php", "symptons");
//同义词
$webAlias = [];
foreach ($alias as $diseaseName => $aliases) {
foreach ($aliases as $aliasName) {
if ($aliasName) $webAlias[$aliasName] = $diseaseName;
}
}
dumpVariableToFile($webAlias, "webData/aliases.php", "aliases");
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。