コード例 #1
0
ファイル: search.php プロジェクト: nyairo/mcl-search
$csf->debug = $arr_param['debug'];
$csf->verbose = $arr_param['verbose'];
/****************************************************************************
 * Set the concept source. Concept sources can be entire dictionaries, subsets 
 * of dictionaries defined by map sources, or concept lists, which can have 
 * concepts in multiple dictionaries). Multiple sources can be used in a single
 * search if separated by commas and all dictionaries can be searched using an 
 * asterisk (*) character. Note that inline sources override global sources. 
 * 
 * Format:
 *
 * 		*|<dictionary_name>[:map(<map_source_id>)]|list(<list_id>)
 *
 ***************************************************************************/
// Parse the source statement
$coll_source_query = new ConceptSearchSourceCollection();
if (isset($arr_param['source']) && $arr_param['source']) {
    $arr_source_text = explode(',', $arr_param['source']);
    foreach ($arr_source_text as $source_text) {
        if ($css = $coll_source->parse($source_text)) {
            $coll_source_query->add($css);
        } else {
            trigger_error('Unrecognized source: ' . $source_text, E_USER_ERROR);
        }
    }
} else {
    $css = $css_default_source;
    $coll_source_query->add($css);
    $arr_param['source'] = $mcl_default_concept_dict_db;
}
// If more than one source, add Custom Source element to the displayed source array
コード例 #2
0
 /**
  * Load concept datatypes for all dictionaries in the passed source collection.
  * @return ConceptDatatypeCollection
  */
 public function loadAllConceptDatatypes(ConceptSearchSourceCollection $coll_source)
 {
     $cdc = new ConceptDatatypeCollection();
     foreach ($coll_source->getDictionaries() as $css_dict) {
         $cdc->merge($this->loadConceptDatatypes($css_dict));
     }
     return $cdc;
 }