本文整理汇总了C++中state_type::feature_vector方法的典型用法代码示例。如果您正苦于以下问题:C++ state_type::feature_vector方法的具体用法?C++ state_type::feature_vector怎么用?C++ state_type::feature_vector使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类state_type
的用法示例。
在下文中一共展示了state_type::feature_vector方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assign
void assign(state_type state, tree_type& tree)
{
features_ += *state.feature_vector();
switch (state.operation().operation()) {
case operation_type::AXIOM:
break;
case operation_type::FINAL:
case operation_type::IDLE:
assign(state.derivation(), tree);
break;
case operation_type::UNARY:
tree.label_ = state.label();
tree.antecedent_.resize(1);
assign(state.derivation(), tree.antecedent_.front());
break;
case operation_type::SHIFT:
tree.label_ = state.label();
tree.antecedent_ = tree_type::antecedent_type(1, state.head());
break;
case operation_type::REDUCE:
case operation_type::REDUCE_LEFT:
case operation_type::REDUCE_RIGHT:
tree.label_ = state.label();
tree.antecedent_.resize(2);
assign(state.reduced(), tree.antecedent_.front());
assign(state.derivation(), tree.antecedent_.back());
break;
}
}