@@ -148,6 +148,9 @@ |
||
| 148 | 148 | return isset($this->metadata[$key]) ? $this->metadata[$key] : null; |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | + /** |
|
| 152 | + * @param integer $length |
|
| 153 | + */ |
|
| 151 | 154 | private function pump($length) |
| 152 | 155 | { |
| 153 | 156 | if ($this->source) { |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | /** |
| 142 | - * @param mixed $param |
|
| 142 | + * @param string|null $param |
|
| 143 | 143 | * @return boolean |
| 144 | 144 | */ |
| 145 | 145 | private function isStringOrNull($param) |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | /** |
| 151 | - * @param mixed $param |
|
| 151 | + * @param string $param |
|
| 152 | 152 | * @return boolean |
| 153 | 153 | */ |
| 154 | 154 | private function isStringNotEmpty($param) |
@@ -179,6 +179,9 @@ |
||
| 179 | 179 | return $emptyPathUri; |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | + /** |
|
| 183 | + * @return string |
|
| 184 | + */ |
|
| 182 | 185 | private static function getRelativePath(UriInterface $base, UriInterface $target) |
| 183 | 186 | { |
| 184 | 187 | $sourceSegments = explode('/', $base->getPath()); |
@@ -31,6 +31,10 @@ discard block |
||
| 31 | 31 | * based on a merge strategy (SingleLink, CompleteLink, GroupAverage, ...) |
| 32 | 32 | * Ex.: for single link this function would be |
| 33 | 33 | * return min($this->dm[$xi],$this->dm[$yi]); |
| 34 | + * @param integer $xi |
|
| 35 | + * @param integer $yi |
|
| 36 | + * @param integer $x |
|
| 37 | + * @param integer $y |
|
| 34 | 38 | */ |
| 35 | 39 | abstract protected function newDistance($xi,$yi,$x,$y); |
| 36 | 40 | |
@@ -73,7 +77,7 @@ discard block |
||
| 73 | 77 | * 3. Merge the clusters (by labeling one as removed) |
| 74 | 78 | * 4. Reheap |
| 75 | 79 | * |
| 76 | - * @return array The pair (x,y) to be merged |
|
| 80 | + * @return integer[] The pair (x,y) to be merged |
|
| 77 | 81 | */ |
| 78 | 82 | public function getNextMerge() |
| 79 | 83 | { |
@@ -138,7 +142,7 @@ discard block |
||
| 138 | 142 | * Note: y will always be larger than x |
| 139 | 143 | * |
| 140 | 144 | * @param integer $index The index to be unraveled |
| 141 | - * @return array An array containing (y,x) |
|
| 145 | + * @return integer[] An array containing (y,x) |
|
| 142 | 146 | */ |
| 143 | 147 | protected function unravelIndex($index) |
| 144 | 148 | { |
@@ -39,8 +39,8 @@ discard block |
||
| 39 | 39 | /** |
| 40 | 40 | * @param FeatureFactoryInterface $ff The feature factory will be applied to each document and the resulting feature array will be considered as a document for LDA |
| 41 | 41 | * @param integer $ntopics The number of topics assumed by the model |
| 42 | - * @param float $a The dirichlet prior assumed for the per document topic distribution |
|
| 43 | - * @param float $b The dirichlet prior assumed for the per word topic distribution |
|
| 42 | + * @param integer $a The dirichlet prior assumed for the per document topic distribution |
|
| 43 | + * @param integer $b The dirichlet prior assumed for the per word topic distribution |
|
| 44 | 44 | */ |
| 45 | 45 | public function __construct(FeatureFactoryInterface $ff,$ntopics,$a=1,$b=1) |
| 46 | 46 | { |
@@ -485,6 +485,10 @@ discard block |
||
| 485 | 485 | |
| 486 | 486 | return $a; |
| 487 | 487 | } |
| 488 | + |
|
| 489 | + /** |
|
| 490 | + * @param integer $k |
|
| 491 | + */ |
|
| 488 | 492 | private function log_multi_beta($a,$y=0,$k=null) |
| 489 | 493 | { |
| 490 | 494 | if ($k==null) { |
@@ -7,6 +7,7 @@ discard block |
||
| 7 | 7 | /** |
| 8 | 8 | * Return a color distributed in the pallete according to $t |
| 9 | 9 | * $t should be in (0,1) |
| 10 | + * @param integer $t |
|
| 10 | 11 | */ |
| 11 | 12 | protected function getColor($t) |
| 12 | 13 | { |
@@ -22,6 +23,7 @@ discard block |
||
| 22 | 23 | |
| 23 | 24 | /** |
| 24 | 25 | * Return a gd handle with a visualization of the clustering or null in case gd is not present. |
| 26 | + * @param \NlpTools\Documents\TrainingSet $tset |
|
| 25 | 27 | */ |
| 26 | 28 | protected function drawClusters($tset, $clusters, $centroids=null, $lines=False,$emphasize=0,$w=300,$h=200) |
| 27 | 29 | { |
@@ -67,6 +69,7 @@ discard block |
||
| 67 | 69 | /** |
| 68 | 70 | * Return a gd handle with a visualization of the given dendrogram or null |
| 69 | 71 | * if gd is not present. |
| 72 | + * @param \NlpTools\Documents\TrainingSet $tset |
|
| 70 | 73 | */ |
| 71 | 74 | protected function drawDendrogram($tset, $dendrogram, $w=300, $h=200) |
| 72 | 75 | { |
@@ -10,6 +10,10 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | if (!function_exists('humbug_get_contents')) { |
| 13 | + |
|
| 14 | + /** |
|
| 15 | + * @param string $filename |
|
| 16 | + */ |
|
| 13 | 17 | function humbug_get_contents($filename, $use_include_path = false, $context = null) |
| 14 | 18 | { |
| 15 | 19 | @trigger_error( |
@@ -414,6 +414,9 @@ discard block |
||
| 414 | 414 | . sprintf('%s.phar.temp.pubkey', $this->getLocalPharFileBasename()); |
| 415 | 415 | } |
| 416 | 416 | |
| 417 | + /** |
|
| 418 | + * @param string|null $localPharFile |
|
| 419 | + */ |
|
| 417 | 420 | protected function setLocalPharFile($localPharFile) |
| 418 | 421 | { |
| 419 | 422 | if (!is_null($localPharFile)) { |
@@ -458,6 +461,9 @@ discard block |
||
| 458 | 461 | $this->tempDirectory = $tempDirectory; |
| 459 | 462 | } |
| 460 | 463 | |
| 464 | + /** |
|
| 465 | + * @param string $phar |
|
| 466 | + */ |
|
| 461 | 467 | protected function validatePhar($phar) |
| 462 | 468 | { |
| 463 | 469 | $phar = realpath($phar); |
@@ -118,6 +118,7 @@ |
||
| 118 | 118 | |
| 119 | 119 | /** |
| 120 | 120 | * Helpers |
| 121 | + * @param string $path |
|
| 121 | 122 | */ |
| 122 | 123 | |
| 123 | 124 | private function getPharOutput($path) |