本文整理汇总了C++中CAction::type方法的典型用法代码示例。如果您正苦于以下问题:C++ CAction::type方法的具体用法?C++ CAction::type怎么用?C++ CAction::type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAction
的用法示例。
在下文中一共展示了CAction::type方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getOrUpdateStackScore
inline void CConParser::getOrUpdateStackScore( CWeight *cast_weights, CPackedScoreType<SCORE_TYPE, CAction::MAX> &retval, const CStateItem *item, const CAction &action, SCORE_TYPE amount , int round ) {
retval.reset();
if (m_Context.stacksize==0) return;
static unsigned long j;
static CCFGSet s0ts1tbt;
s0ts1tbt.copy(m_Context.s0ts1tbt);
#ifdef _CHINESE_CFG_H
// static unsigned long s0c_bracket_action;
// static unsigned long s1c_bracket_action;
// static unsigned long n0t_bracket_action;
// static unsigned long s0cs1c_bracket_action;
// static unsigned long s0cn0t_bracket_action;
#endif
// static unsigned long s0cs1c_distaction;
#ifdef _CHINESE_CFG_H
// s0c_bracket_action = encodeAction(action, m_Context.s0c_bracket);
// s1c_bracket_action = encodeAction(action, m_Context.s1c_bracket);
// n0t_bracket_action = encodeAction(action, m_Context.n0t_bracket);
// s0cs1c_bracket_action = encodeAction(action, m_Context.s0cs1c_bracket);
// s0cn0t_bracket_action = encodeAction(action, m_Context.s0cn0t_bracket);
#endif
// s0cs1c_distaction = encodeAction(action, m_Context.s0cs1c_dist);
static CTuple2<CWord, CConstituent> word_constituent;
static CTuple2<CTag, CConstituent> tag_constituent;
static CTuple2<CTwoWords, CCFGSet> twoword_cfgset;
static CTuple2<CWord, CCFGSet> word_cfgset;
static CActionType actionType;
actionType.code = action.type();
const CAction &a1 = item->action;
const CAction &a2 = item->statePtr->action;
static CTuple2<CAction, CAction> tuple_action2;
// CWeight* cast_weights = (amount&&(round!=-1)) ? m_delta : static_cast<CWeight*>(m_weights);
// S0
cast_weights->m_mapS0w.getOrUpdateScore(retval, *(m_Context.s0wt), action.code(), m_nScoreIndex, amount, round);
if (!m_Context.s0c.empty()) cast_weights->m_mapS0c.getOrUpdateScore(retval, m_Context.s0c, action.code(), m_nScoreIndex, amount, round);
refer_or_allocate_tuple2(tag_constituent, &(m_Context.s0t), &(m_Context.s0c));
cast_weights->m_mapS0tc.getOrUpdateScore(retval, tag_constituent, action.code(), m_nScoreIndex, amount, round);
refer_or_allocate_tuple2(word_constituent, m_Context.s0w, &(m_Context.s0c));
cast_weights->m_mapS0wc.getOrUpdateScore(retval, word_constituent, action.code(), m_nScoreIndex, amount, round);
// S1
if (m_Context.s1!=0) {
cast_weights->m_mapS1w.getOrUpdateScore(retval, *(m_Context.s1wt), action.code(), m_nScoreIndex, amount, round);
if (!m_Context.s1c.empty()) cast_weights->m_mapS1c.getOrUpdateScore(retval, m_Context.s1c, action.code(), m_nScoreIndex, amount, round);
refer_or_allocate_tuple2(tag_constituent, &(m_Context.s1t), &(m_Context.s1c));
cast_weights->m_mapS1tc.getOrUpdateScore(retval, tag_constituent, action.code(), m_nScoreIndex, amount, round);
refer_or_allocate_tuple2(word_constituent, m_Context.s1w, &(m_Context.s1c));
cast_weights->m_mapS1wc.getOrUpdateScore(retval, word_constituent, action.code(), m_nScoreIndex, amount, round);
}
// S2
if (m_Context.s2!=0) {
// cast_weights->m_mapS2w.getOrUpdateScore(retval, *(m_Context.s2w), action.code(), m_nScoreIndex, amount, round);
// cast_weights->m_mapS2c.getOrUpdateScore(retval, s2c_action, action.code(), m_nScoreIndex, amount, round);
refer_or_allocate_tuple2(tag_constituent, &(m_Context.s2t), &(m_Context.s2c));
cast_weights->m_mapS2tc.getOrUpdateScore(retval, tag_constituent, action.code(), m_nScoreIndex, amount, round);
refer_or_allocate_tuple2(word_constituent, m_Context.s2w, &(m_Context.s2c));
cast_weights->m_mapS2wc.getOrUpdateScore(retval, word_constituent, action.code(), m_nScoreIndex, amount, round);
}
// S3
if (m_Context.s3!=0) {
// cast_weights->m_mapS3w.getOrUpdateScore(retval, *(m_Context.s3w), action.code(), m_nScoreIndex, amount, round);
// cast_weights->m_mapS3c.getOrUpdateScore(retval, s3c_action, action.code(), m_nScoreIndex, amount, round);
refer_or_allocate_tuple2(tag_constituent, &(m_Context.s3t), &(m_Context.s3c));
cast_weights->m_mapS3tc.getOrUpdateScore(retval, tag_constituent, action.code(), m_nScoreIndex, amount, round);
refer_or_allocate_tuple2(word_constituent, m_Context.s3w, &(m_Context.s3c));
cast_weights->m_mapS3wc.getOrUpdateScore(retval, word_constituent, action.code(), m_nScoreIndex, amount, round);
}
// N0
if (m_Context.n0!=-1) {
// cast_weights->m_mapN0w.getOrUpdateScore(retval, *(m_Context.n0w), action.code(), m_nScoreIndex, amount, round);
// cast_weights->m_mapN0t.getOrUpdateScore(retval, n0t_action, action.code(), m_nScoreIndex, amount, round);
cast_weights->m_mapN0wt.getOrUpdateScore(retval, *(m_Context.n0wt), action.code(), m_nScoreIndex, amount, round);
}
// N1
if (m_Context.n1!=-1) {
// cast_weights->m_mapN1w.getOrUpdateScore(retval, *(m_Context.n1w), action.code(), m_nScoreIndex, amount, round);
// cast_weights->m_mapN1t.getOrUpdateScore(retval, n1t_action, action.code(), m_nScoreIndex, amount, round);
cast_weights->m_mapN1wt.getOrUpdateScore(retval, *(m_Context.n1wt), action.code(), m_nScoreIndex, amount, round);
}
// N2
if (m_Context.n2!=-1) {
//.........这里部分代码省略.........