本文整理汇总了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;
}