本文整理汇总了C++中yvector::insert方法的典型用法代码示例。如果您正苦于以下问题:C++ yvector::insert方法的具体用法?C++ yvector::insert怎么用?C++ yvector::insert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yvector
的用法示例。
在下文中一共展示了yvector::insert方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ArchiveAutomatSymbolInterpetationUnions
void CWord::ArchiveAutomatSymbolInterpetationUnions(yvector<TerminalSymbolType>& vecUnionsArchive)
{
if (m_AutomatSymbolInterpetationUnion.size() == 0)
return;
vecUnionsArchive.push_back(m_AutomatSymbolInterpetationUnion.size());
vecUnionsArchive.insert(vecUnionsArchive.end(), m_AutomatSymbolInterpetationUnion.begin(), m_AutomatSymbolInterpetationUnion.end());
for (SHomIt it = IterHomonyms(); it.Ok(); ++it) {
vecUnionsArchive.push_back(it->m_AutomatSymbolInterpetationUnion.size());
vecUnionsArchive.insert(vecUnionsArchive.end(), it->m_AutomatSymbolInterpetationUnion.begin(), it->m_AutomatSymbolInterpetationUnion.end());
}
}
示例2: SubstituteByMultiWord
void CMultiWordCreator::SubstituteByMultiWord(SWordHomonymNum& WordHomonymNum, yvector<SWordHomonymNum>& WordIndexes)
{
const CWord& multi_word = m_Words.GetWord(WordHomonymNum);
int k1 = -1, k2 = -1;
for (size_t i = 0; i < WordIndexes.size(); i++) {
const CWord& w = m_Words.GetWord(WordIndexes[i]);
if ((w.IsOriginalWord()) &&
(w.GetSourcePair().FirstWord() == multi_word.GetSourcePair().FirstWord()))
k1 = i;
if (k1 != -1) {
if (!w.IsOriginalWord())
break;
if (w.GetSourcePair().FirstWord() == multi_word.GetSourcePair().LastWord()) {
k2 = i;
break;
}
}
}
if ((k1 != -1) && (k2 != -1))
for (int j = k2; j >= k1; j--)
WordIndexes.erase(WordIndexes.begin() + j);
if (k1 != -1)
WordIndexes.insert(WordIndexes.begin() + k1, WordHomonymNum);
}
示例3: BuildClauseVariantsRec
void CTopClauses::BuildClauseVariantsRec(yvector<CClauseVariant>& ClauseVars, CClauseNode* node)
{
yvector<CClauseVariant> saveVars;
if (node->m_outNodes.size() > 1)
saveVars = ClauseVars;
for (size_t i = 0; i < node->m_outNodes.size(); i++) {
CClauseNode* node1 = node->m_outNodes[i].m_pNode;
if (node1->IsEndNode())
return;
if (i == 0) {
for (size_t j = 0; j < ClauseVars.size(); j++)
AddClausesToClauseVar(ClauseVars[j], node1->m_pClauseTree);
//ClauseVars[j].AddClauses(node1->m_pClauseTree->m_Clauses);
BuildClauseVariantsRec(ClauseVars, node1);
} else {
yvector<CClauseVariant> saveVarsCopy = saveVars;
for (size_t j = 0; j < saveVarsCopy.size(); j++)
AddClausesToClauseVar(saveVarsCopy[j], node1->m_pClauseTree);
//saveVarsCopy[j].AddClauses(node1->m_pClauseTree->m_Clauses);
BuildClauseVariantsRec(saveVarsCopy, node1);
ClauseVars.insert(ClauseVars.end(), saveVarsCopy.begin(), saveVarsCopy.end());
}
}
}
示例4: FindCloseQuoteInNextSentences
// ищет закрывающую кавычку в текущем или последующем предложениях,
// добавляет все слова до закрывающей кавычки к ResultToAdd
// игнорируем внутренние кавычки
bool CQuotesFinder::FindCloseQuoteInNextSentences(int StartSentNo, int StartWordForFirstSentence, Wtroka& ResultToAdd,
yvector<SFactAddress>& FioInQuotes, SLeadInfo& LeadInfo)
{
Wtroka Add;
yvector<SFactAddress> AddFioInQuotes;
int Depth = 1;
for (int SentNo=StartSentNo; (SentNo-StartSentNo<=2)&& (SentNo< (int)m_vecSentence.size()); SentNo++) {
CSentenceRusProcessor* pSent = GetSentPrc(SentNo);
yset<int> QuoteWords;
int k=0;
if (SentNo == StartSentNo)
k = StartWordForFirstSentence;
for (; k < (int)pSent->getWordsCount(); k++) {
const CWord& w = *pSent->getWordRus(k);
Add += w.GetOriginalText() + ' ';
QuoteWords.insert(k);
bool bHasCloseQuote = false;
if (w.HasOpenQuote()) {
if (ispunct(w.GetText()[0])) {
Depth--; // одиночную кавычку знака препинания считаем закр. кавычкой (кто-то по ошибке поставил пробел)
bHasCloseQuote = true;;
} else
Depth++;
}
if (w.HasCloseQuote()) {
Depth--;
if ((Depth == 1) // Закрывающая кавычка в конце предложения закрывает все открытые кавычки.
&& ((k+1 == (int)pSent->getWordsCount())
|| ((k+2 == (int)pSent->getWordsCount())
&& pSent->getWordRus(k+1)->IsPunct()
)
)
) {
Depth = 0;
}
bHasCloseQuote = true;
}
if (w.GetText() == Wtroka::FromAscii("\"")) {
if (k+1 == (int)pSent->getWordsCount() || pSent->getWordRus(k+1)->IsPunct()) {
bHasCloseQuote = true;
Depth--;
}
}
if (bHasCloseQuote && Depth == 0) {
if (!Add.empty() && Add[0] == '-') {
const wchar16* beg = Add.begin() + 1;
StripRangeBegin(beg, Add.end());
Add.assign(beg, Add.end() - beg);
}
if (ResultToAdd.back() == ',' && Add.size() > 0 && NStr::IsLangAlpha(Add[0], TMorph::GetMainLanguage()) && ::IsUpper(Add[0])) {
ResultToAdd.erase(ResultToAdd.size() - 1);
ResultToAdd += CharToWide(". ");
}
ResultToAdd += Add;
AddFios(SentNo, QuoteWords, AddFioInQuotes);
FioInQuotes.insert(FioInQuotes.end(), AddFioInQuotes.begin(), AddFioInQuotes.end());
LeadInfo.m_iLastSent = SentNo;
return true;
}
}
AddFios(SentNo, QuoteWords, AddFioInQuotes);
}
return false;
}