Changeset 12650

Show
Ignore:
Timestamp:
02/22/08 22:36:58 (11 months ago)
Author:
pottedmeat
Message:

Refs #5602. Add some intelligent guessing for some ambiguations

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • util/branches/dev/jsdoc/jsdoc.module

    r12649 r12650  
    132132      } 
    133133 
    134       if ($node = jsdoc_object_node_load($name, $project, $version, $resource)) { 
     134      if ($node = jsdoc_object_nodes_load($name, $project, $version, $resource)) { 
     135        if (count($node) == 1) { 
     136          $node = $node[0]; 
     137        } 
    135138        $item = array( 
    136139          'path' => $path, 
     
    19011904  } 
    19021905  elseif (!empty($nodes)) { 
    1903     return $nodes; 
     1906    $most_similar = 0; 
     1907    foreach($nodes as $match) { 
     1908      similar_text($match->title, jsdoc_get_project($match)->title, $similarity); 
     1909      if ($similarity > $most_similar) { 
     1910        $node = $match; 
     1911        $most_similar = $similarity; 
     1912      } 
     1913    } 
     1914    return $node; 
    19041915  } 
    19051916}