Remove unused methods

This commit is contained in:
Gregory Trolliet 2020-11-25 22:53:07 +01:00
parent e072182ed4
commit 0980d0a82f
2 changed files with 6 additions and 27 deletions

25
db.php
View file

@ -163,31 +163,6 @@ class DataBase
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(
string $ref,
string $text = '',

View file

@ -12,8 +12,12 @@ if (!isset($_GET['id'])) {
}
$id = $_GET['id'];
if ($words = $db->getWordsRelative($id)) {
echo json_encode($words);
if ($words = $db->getWordsList($id)) {
$wordsClean = [];
foreach ($words as $key => $word) {
$wordsClean[] = array($word['word'], $word['relative']);
}
echo json_encode($wordsClean);
} else {
echo json_encode('No id');
}