fix count paragraph search

This commit is contained in:
Jesús 2019-04-27 14:49:06 -05:00
parent e4b891bed6
commit 16703c9cea
No known key found for this signature in database
GPG Key ID: F6EE7BC59A315766

View File

@ -32,7 +32,7 @@ $STOP_WORDS = ['a', 'un', 'una', 'unas', 'unos', 'uno', 'sobre', 'todo',
'trabajas', 'trabaja', 'trabajamos', 'trabajais', 'trabajan', 'podria',
'podrias', 'podriamos', 'podrian', 'podriais', 'yo', 'aquel'];
$DESCRIPTION_LENGTH = 20;
$DESCRIPTION_LENGTH = 25;
$HALF_DESCRIPTION_LENGTH = floor($DESCRIPTION_LENGTH / 2);
$web_content = json_decode(file_get_contents('tipuesearch_content.json'), true);
@ -158,7 +158,7 @@ if (isset($_GET['q'])) {
break;
} else {
echo '<div class="tipue_search_content_text">';
for ($i = 0; $i < $description_words_count - floor($description_words_count/2); $i++) {
for ($i = 0; $i < $DESCRIPTION_LENGTH; $i++) {
echo $description_words[$i] . ' ';
}
if ($description_words_count > $DESCRIPTION_LENGTH) {