Lines Matching defs:words
25 * The added text replaces previous words for the same page.
49 $words = $this->getPageWords($text);
50 if ($words === false) {
55 if (!empty($words)) {
56 foreach (array_keys($words) as $wlen) {
58 foreach ($words[$wlen] as $wid => $freq) {
103 * Split the words in a page and add them to the index.
118 $words = [];
121 if (isset($words[$l])) {
122 $words[$l][$w] = $c + ($words[$l][$w] ?? 0);
124 $words[$l] = [$w => $c];
128 // arrive here with $words = array(wordlen => array(word => frequency))
130 foreach (array_keys($words) as $wlen) {
133 foreach ($words[$wlen] as $word => $freq) {
490 * Split the text into words for fulltext search
500 * @return array list of words in the text
599 * Find pages in the fulltext index containing the words,
601 * The search words must be pre-tokenized, meaning only letters and
608 * @param array $tokens list of words to search for
619 // load known words and documents
680 // get all words in order to search the matching ids
682 $words = $this->getIndex('title', '');
684 $words = $this->getIndex($metaname . '_w', '');
689 foreach ($words as $i => $word) {
710 foreach (array_keys(preg_grep('/' . $re . '/', $words)) as $i)
712 } elseif (($i = array_search($val, $words, true)) !== false) {
718 unset($words); // free the used memory
761 * @param array $words The query terms.
767 protected function getIndexWords(&$words, &$result)
772 foreach ($words as $word) {
874 * Return a list of words sorted by number of times used
878 * @param int $minlen minimum length of words to count
880 * @return array list of words as the keys and frequency as values
910 $words = $this->getIndex($metaname . '_w', '');
912 if (strlen($words[$wid]) >= $minlen)
913 $result[$words[$wid]] = $freq;
921 $words = null;
925 if ($words === null)
926 $words = $this->getIndex('w', $length);
927 $result[$words[$wid]] = $freq;
1129 * a sorted array of lengths of the words used in the wiki.