本文整理汇总了C++中yvector::ysize方法的典型用法代码示例。如果您正苦于以下问题:C++ yvector::ysize方法的具体用法?C++ yvector::ysize怎么用?C++ yvector::ysize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yvector
的用法示例。
在下文中一共展示了yvector::ysize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SaveParadigma
void TSurnamePredictor::SaveParadigma(TSurnameLemma& surnameLemma, yvector<TTempForm>& paradigma)
{
if (surnameLemma.SurnameFlex.empty() ||
(surnameLemma.Weight == 0))
return;
TGramBitSet stemGram;
SurnameLemmasFlex.push_back(surnameLemma);
unsigned char c = gBefore + 1;
for (; c < gMax ; c++)
{
int i;
for (i = 0 ; i < paradigma.ysize() ; i++)
{
if (!paradigma[i].Grammars.Test(NTGrammarProcessing::ch2tg(c)))
break;
}
if (i >= paradigma.ysize())
stemGram.Set(NTGrammarProcessing::ch2tg(c));
}
Stroka ss = stemGram.ToString(",");
for (int i = 0 ; i < paradigma.ysize() ; i++)
{
TSurnameFlexMap::iterator it = SurnameFlex2Paradigmas.find(paradigma[i].Flex);
if (it == SurnameFlex2Paradigmas.end())
{
TFormInfo formInfo;
formInfo.SurnameLemmaFlexNo = SurnameLemmasFlex.ysize() - 1;
formInfo.StemGrammar = stemGram;
ss = TGramBitSet(paradigma[i].Grammars & ~stemGram).ToString(",");
formInfo.FlexGrammars.push_back(paradigma[i].Grammars & ~stemGram);
SurnameFlex2Paradigmas[paradigma[i].Flex] = yvector<TFormInfo>(1,formInfo);
} else {
yvector<TFormInfo>& infos = it->second;
int j;
for (j = 0; j < infos.ysize(); j++) {
if (infos[j].SurnameLemmaFlexNo == (SurnameLemmasFlex.ysize() - 1)) {
ss = TGramBitSet(paradigma[i].Grammars & ~stemGram).ToString(",");
infos[j].FlexGrammars.push_back(paradigma[i].Grammars & ~stemGram);
break;
}
}
if (j >= infos.ysize()) {
TFormInfo formInfo;
formInfo.SurnameLemmaFlexNo = SurnameLemmasFlex.ysize() - 1;
formInfo.StemGrammar = stemGram;
ss = TGramBitSet(paradigma[i].Grammars & ~stemGram).ToString(",");
formInfo.FlexGrammars.push_back(paradigma[i].Grammars & ~stemGram);
infos.push_back(formInfo);
}
}
}
}