本文整理汇总了C++中PBowDocBs::GetDId方法的典型用法代码示例。如果您正苦于以下问题:C++ PBowDocBs::GetDId方法的具体用法?C++ PBowDocBs::GetDId怎么用?C++ PBowDocBs::GetDId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PBowDocBs
的用法示例。
在下文中一共展示了PBowDocBs::GetDId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetNmObjDIdV
void TNmObjBs::GetNmObjDIdV(
const PBowDocBs& BowDocBs, TIntV& BowDIdV,
const TStr& NmObjStr1, const TStr& NmObjStr2) const {
// get first named-object-id
int NmObjId1=GetNmObjId(NmObjStr1);
TIntV NmObjDocIdV1; GetNmObjDocIdV(NmObjId1, NmObjDocIdV1);
NmObjDocIdV1.Sort();
// get second named-object-id
TIntV NmObjDocIdV2;
if (!NmObjStr2.Empty()){
int NmObjId2=GetNmObjId(NmObjStr2);
GetNmObjDocIdV(NmObjId2, NmObjDocIdV2);
NmObjDocIdV2.Sort();
}
// create joint doc-id-vector
TIntV NmObjDocIdV;
if (NmObjDocIdV2.Empty()){
NmObjDocIdV=NmObjDocIdV1;
} else {
NmObjDocIdV1.Intrs(NmObjDocIdV2, NmObjDocIdV);
}
// traverse named-object-documents to collect bow-document-ids
BowDIdV.Gen(NmObjDocIdV.Len(), 0);
for (int NmObjDocIdN=0; NmObjDocIdN<NmObjDocIdV.Len(); NmObjDocIdN++){
TStr DocNm=GetDocNm(NmObjDocIdV[NmObjDocIdN]);
int DId=BowDocBs->GetDId(DocNm);
if (DId!=-1){
BowDIdV.Add(DId);
}
}
}
示例2: GetDocCentroid
void TSkyGridEnt::GetDocCentroid(const TSkyGridBs* SkyGridBs,
const PBowDocBs& BowDocBs, const PBowDocWgtBs& BowDocWgtBs,
const uint64& MnTm, const int& TopWords, const double& TopWordsWgtSumPrc,
int& Docs, TStrFltPrV& WordStrWgtPrV) const {
// get doc-ids
TIntV DocIdV; GetDocIdV(SkyGridBs, MnTm, 0, DocIdV);
TIntV BowDIdV(DocIdV.Len(), 0);
for (int DocN=0; DocN<DocIdV.Len(); DocN++){
int DocId=DocIdV[DocN];
TStr BowDocNm=TInt::GetStr(DocId);
int BowDId=BowDocBs->GetDId(BowDocNm);
BowDIdV.Add(BowDId);
}
// create concept vector
PBowSim BowSim=TBowSim::New(bstCos); // similarity object
PBowSpV ConceptSpV=TBowClust::GetConceptSpV(BowDocWgtBs, BowSim, BowDIdV);
// get docs & word-vector
Docs=DocIdV.Len();
ConceptSpV->GetWordStrWgtPrV(BowDocBs, TopWords, TopWordsWgtSumPrc, WordStrWgtPrV);
}