Remove unused methods
This commit is contained in:
parent
e072182ed4
commit
0980d0a82f
2 changed files with 6 additions and 27 deletions
25
db.php
25
db.php
|
@ -163,31 +163,6 @@ class DataBase
|
||||||
return $words;
|
return $words;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getWordsPercentage(string $id)
|
|
||||||
{
|
|
||||||
$words = $this->getWordsList($id);
|
|
||||||
$total = 0;
|
|
||||||
foreach ($words as $word) {
|
|
||||||
$total += $word[1];
|
|
||||||
}
|
|
||||||
foreach ($words as $key => $word) {
|
|
||||||
$words[$key] = array($word[0], $word[1] / $total);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $words;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getWordsRelative(string $id)
|
|
||||||
{
|
|
||||||
$words = $this->getWordsList($id);
|
|
||||||
$wordsClean = [];
|
|
||||||
foreach ($words as $key => $word) {
|
|
||||||
$wordsClean[] = array($word['word'], $word['relative']);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $wordsClean;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function createCloud(
|
public function createCloud(
|
||||||
string $ref,
|
string $ref,
|
||||||
string $text = '',
|
string $text = '',
|
||||||
|
|
8
get.php
8
get.php
|
@ -12,8 +12,12 @@ if (!isset($_GET['id'])) {
|
||||||
}
|
}
|
||||||
$id = $_GET['id'];
|
$id = $_GET['id'];
|
||||||
|
|
||||||
if ($words = $db->getWordsRelative($id)) {
|
if ($words = $db->getWordsList($id)) {
|
||||||
echo json_encode($words);
|
$wordsClean = [];
|
||||||
|
foreach ($words as $key => $word) {
|
||||||
|
$wordsClean[] = array($word['word'], $word['relative']);
|
||||||
|
}
|
||||||
|
echo json_encode($wordsClean);
|
||||||
} else {
|
} else {
|
||||||
echo json_encode('No id');
|
echo json_encode('No id');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue