本文整理汇总了C++中yvector::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ yvector::push_back方法的具体用法?C++ yvector::push_back怎么用?C++ yvector::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yvector
的用法示例。
在下文中一共展示了yvector::push_back方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SolveAmbiguity
void SolveAmbiguity(yvector<COccurrence>& Occurrences, yvector<COccurrence>& DroppedOccurrences)
{
yvector<size_t> res;
SolveAmbiguity(Occurrences, res);
if (res.size() != Occurrences.size()) {
std::sort(res.begin(), res.end());
yvector<COccurrence> tmp(res.size());
for (size_t i = 0; i < res.size(); ++i)
tmp[i] = Occurrences[res[i]];
size_t next_res_index = 0;
res.push_back(Occurrences.size());
for (size_t j = 0; j < Occurrences.size(); ++j)
if (j == res[next_res_index])
next_res_index += 1;
else
DroppedOccurrences.push_back(Occurrences[j]);
Occurrences.swap(tmp);
}
}
示例2: Add
void Add(const char* cardinal, const char* ordinal, const char* adverb, const char* noun, ui64 integer, int fract = 0) {
SNumeral2Number item(cardinal, ordinal, adverb, noun, integer, fract);
CardinalIndex[item.m_Cardinal] = List.size();
OrdinalIndex[item.m_Ordinal] = List.size();
List.push_back(item);
}
示例3: IsAnalyticalVerbForm
//check an agreement between aux. verbs and predicates of analitical form.
bool CAnalyticFormBuilder::IsAnalyticalVerbForm(int iVerbWrd, int iSWrd, int& VerbHomNo,
yvector<int>& AnalyticHom, bool& b_AddAuxVerbHom)
{
b_AddAuxVerbHom = false;
AnalyticHom.clear();
const CWord& _Be = m_Words.GetWord(m_ClauseWords.at(iVerbWrd));
const CWord& _Predik = m_Words.GetWord(m_ClauseWords.at(iSWrd));
//с предикативными значениями "много" и "мало" анал. форм не строить : DIALING
//с предикативными значениями "много" и "мало" анал. форм строится, но клонируется омоним для вспомогательного глагола
//if ( ( m_Words[iSWrd].FindLemma("МНОГО") || m_Words[iSWrd].FindLemma("МАЛО") ) && ... )
if (_Predik.HasPOS(gNumeral) && _Predik.HasPOS(gPraedic))
b_AddAuxVerbHom = true;
//14.07.04: отсутствие синтаксиса порождает заплатку:
//если у потенциального предиката есть омоним Noun, то добавить омоним AuxVerb для вспомогательного глагола,
//в противном случае, просто изменить часть речи на AuxVerb.
if (_Predik.HasMorphNoun())
b_AddAuxVerbHom = true;
//masks used later (to avoid constructing them repeatedly in loop)
const TGramBitSet Verb_Infinitive(gVerb, gInfinitive),
Infinitive_Imperfect(gInfinitive, gImperfect),
Person3_Singular(gPerson3, gSingular),
Infinitive_Gerund(gInfinitive, gGerund);
for (CWord::SHomIt it = _Be.IterHomonyms(); it.Ok(); ++it) {
VerbHomNo = it.GetID();
const CHomonym& VerbHom = _Be.GetRusHomonym(VerbHomNo);
if (VerbHom.Lemma == kByt || (VerbHom.Lemma == kStat && VerbHom.HasAnyOfPOS(Verb_Infinitive))) {
for (CWord::SHomIt it_predik = _Predik.IterHomonyms(); it_predik.Ok(); ++it_predik) {
int j = it_predik.GetID();
const CHomonym& ShortFormHom = _Predik.GetRusHomonym(j);
if (ShortFormHom.Grammems.HasAll(Infinitive_Imperfect) && (VerbHom.IsFutureTense() || VerbHom.Lemma == kStat))
AnalyticHom.push_back(j);
else if ((ShortFormHom.HasGrammem(gPraedic)) &&
(VerbHom.HasGrammem(gNeuter) || (VerbHom.IsFutureTense() && VerbHom.Grammems.HasAll(Person3_Singular))))
AnalyticHom.push_back(j);
else if (ShortFormHom.HasGrammem(gComparative) && ShortFormHom.IsFullAdjective())
AnalyticHom.push_back(j);
else if (ShortFormHom.IsShortAdjectiveOrParticiple()) {
// "была", "стал", "был", "было" ...
if ((VerbHom.HasGrammem(gSingular) && VerbHom.IsPastTense() &&
ShortFormHom.HasGrammem(gSingular) &&
(VerbHom.Grammems.All() & ShortFormHom.Grammems.All()).HasAny(NSpike::AllGenders))
|| (VerbHom.HasGrammem(gPlural) && ShortFormHom.HasGrammem(gPlural))
|| (!VerbHom.IsPastTense() && VerbHom.HasGrammem(gSingular) && ShortFormHom.HasGrammem(gSingular))
|| VerbHom.Grammems.HasAny(Infinitive_Gerund))
AnalyticHom.push_back(j);
}
}
return AnalyticHom.size() > 0;
}
}
return false;
}
示例4: ConvertIntVectorIntoFilter
void ConvertIntVectorIntoFilter(const yvector<int>& v_Filter, yvector<CFilterPair>& r_Filter)
{
for (int i = 1; i < (int)v_Filter.size(); i=i+2)
r_Filter.push_back(CFilterPair(v_Filter[i-1], v_Filter[i]));
}
示例5: InitWordIndexes
void CMultiWordCreator::InitWordIndexes(yvector<SWordHomonymNum>& WordIndexes)
{
for (size_t i = 0; i < m_Words.OriginalWordsCount(); i++)
WordIndexes.push_back(SWordHomonymNum(i, -1));
}