262{
263
264
265
267 auto newy = std::get<0>(clType);
268 auto f = std::get<1>(clType);
269 auto pre = std::get<2>(clType);
270 auto tmpNode = y;
272
273
274 tmpLabel =
suffix(tmpLabel, newy->label().size() - tmpNode->label().size());
275 tmpNode = newy;
276 if (f == nullptr)
277 {
278
279
280 auto v = new SuffixTreeNode(tmpNode,tmpLabel,isFullPattern);
281 if (tmpNode->label().size() != 0 && v->arcLabel().size() == 1)
282 return std::make_tuple(tmpNode,tmpNode,v);
283 else
284 return std::make_tuple(tmpNode,nullptr,v);
285 }
286
288
289 p->setPatternLeafCount(f->patternLeafCount());
290 p->addToPatternLeafCount(isFullPattern);
291 p->addToPatternLeafCount(f->isFullPattern());
292
293 tmpLabel =
suffix(tmpLabel,pre.size());
294
295 auto w =
new SuffixTreeNode (
p,tmpLabel,isFullPattern);
296
297 if (tmpLabel.size() == 1)
298 return std::make_tuple(
p,
p,w);
299 else
300 return std::make_tuple(
p,
nullptr,w);
301}
Word suffix(const Word vec, int indexOfSuffix)
auto contractedLocus(SuffixTreeNode *y, const Word &s, bool incrementLeafCount=false) const -> ContractedLocusType
auto splitArc(SuffixTreeNode *f, const Word &prefix) -> SuffixTreeNode *