Lines Matching defs:line

867         foreach ($lines as $line) {
868 $pages = array_merge($pages, $this->parseTuples($page_idx, $line));
904 foreach ($index as $wid => $line) {
905 $freq = $this->countTuples($line);
922 foreach ($index as $wid => $line) {
923 $freq = $this->countTuples($line);
1033 * Retrieve a line from the index.
1037 * @param int $id the line number
1038 * @return string a line with trailing whitespace removed
1050 while (($line = fgets($fh)) !== false) {
1054 return rtrim((string)$line);
1058 * Write a line into the index.
1062 * @param int $id the line number
1063 * @param string $line line to write
1068 protected function saveIndexKey($idx, $suffix, $id, $line)
1071 if (!str_ends_with($line, "\n"))
1072 $line .= "\n";
1080 fwrite($fh, (++$ln == $id) ? $line : $curline);
1085 fwrite($fh, $line);
1092 fwrite($fh, $line);
1106 * @param string $value line to find in the index
1107 * @return int|bool line number of the value in the index or false if writing the index failed
1175 * Insert or replace a tuple in a line.
1179 * @param string $line
1184 protected function updateTuple($line, $id, $count)
1186 if ($line != '') {
1187 $line = preg_replace('/(^|:)' . preg_quote($id, '/') . '\*\d*/', '', $line);
1189 $line = trim($line, ':');
1191 if ($line) {
1192 return "$id*$count:" . $line;
1197 return $line;
1201 * Split a line into an array of tuples.
1207 * @param string $line
1210 protected function parseTuples(&$keys, $line)
1213 if ($line == '') return $result;
1214 $parts = explode(':', $line);
1233 * @param string $line
1236 protected function countTuples($line)
1239 $parts = explode(':', $line);