當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Source::id方法代碼示例

本文整理匯總了PHP中Source::id方法的典型用法代碼示例。如果您正苦於以下問題:PHP Source::id方法的具體用法?PHP Source::id怎麽用?PHP Source::id使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Source的用法示例。


在下文中一共展示了Source::id方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _make_linguistic_object

 public function _make_linguistic_object($fieldsAndValues)
 {
     $logger = Logger::getLogger('LinguisticObjects.makeLinguisticObject');
     $logger->debug("\$fieldsAndValues= " . print_r($fieldsAndValues, TRUE));
     $type = $fieldsAndValues['type'];
     $logger->debug("type= {$type}");
     $obj = NULL;
     if ($type == 'n' || $type == 'a' || $type == 'e' || $type == 'c') {
         $obj = new NounRoot($fieldsAndValues);
         array_push(self::$rootIDs, $obj->id());
     } elseif ($type == 'v') {
         $obj = new VerbRoot($fieldsAndValues);
         array_push(self::$rootIDs, $obj->id());
     } elseif ($type == 's') {
         $obj = new Source($fieldsAndValues);
         array_push(self::$sourceIDs, $obj->id());
     } elseif ($type == 'sn' || $type == 'sv' || $type == 'q') {
         $obj = new Suffix($fieldsAndValues);
         array_push(self::$affixIDs, $obj->id());
     } elseif ($type == 'tn') {
         $obj = new NounEnding($fieldsAndValues);
         array_push(self::$affixIDs, $obj->id());
     } elseif ($type == 'tv') {
         $obj = new VerbEnding($fieldsAndValues);
         array_push(self::$affixIDs, $obj->id());
     } elseif ($type == 'vw') {
         $obj = new VerbWord($fieldsAndValues);
         self::$verbWords[$object->getVerb()] = $obj;
     } elseif ($type == 'pr') {
         $obj = new Pronoun($fieldsAndValues);
         array_push(self::$rootIDs, $obj->id());
     } elseif ($type == 'pd' || $type == 'ad') {
         $obj = new Demonstrative($fieldsAndValues);
         array_push(self::$rootIDs, $obj->id());
         $roots = explode(' ', $obj->get_root());
         foreach ($roots as $a_root) {
             $newFieldsAndValues = $fieldsAndValues;
             $newFieldsAndValues['morpheme'] = $a_root;
             $newFieldsAndValues['root'] = $a_root;
             $new_obj = new Demonstrative($newFieldsAndValues);
             array_push(self::$rootIDs, $new_obj->id());
         }
     } else {
         $logger->debug("type '{$type}' not supported yet");
     }
     return $obj;
 }
開發者ID:nrc-cnrc,項目名稱:InuktitutToolkit,代碼行數:47,代碼來源:InuktitutLinguisticModel.php


注:本文中的Source::id方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。