143{
144
146 auto plList = std::vector<int> {};
147 Label tempS(w.begin(),w.end());
149 tempS.push_back(-(wordNum + 1));
152 bool isFullPattern = true;
153 while (
s.size() != 0)
154 {
158 else insertType =
insertStepC(v,v->parent()->suffixLink(),Word(v->arcLabel()),
s,isFullPattern);
159 auto newv = std::get<0>(insertType);
160 auto roRoot = std::get<1>(insertType);
161 auto newLocus = std::get<2>(insertType);
162 v = newv;
163 if (roRoot != nullptr)
164 {
165 plList.clear();
167 for(auto pl : plList)
168 {
169 auto ro0 = newLocus->getPatternNumber();
170 auto ro1 =
mMonomials[ro0].size() - roRoot->label().size();
171 auto ro2 = pl;
172 rightOverlaps.push_back(std::make_tuple(ro0,ro1,ro2,true));
173 }
174 }
175 if (v !=
mRoot &&
s.size() == 2)
176 {
177 v->setSuffixLink(
mRoot);
178 }
180 isFullPattern = false;
181 }
183}
Word suffix(const Word vec, int indexOfSuffix)
std::tuple< SuffixTreeNode *, SuffixTreeNode *, SuffixTreeNode * > InsertType
auto insertStepD(SuffixTreeNode *y, const Word &s, bool isFullPattern) -> InsertType
auto patternLeaves(SuffixTreeNode *v, std::vector< int > &output) const -> void
auto insertStepC(SuffixTreeNode *v, SuffixTreeNode *x, const Word &beta, const Word &s, bool isFullPattern) -> InsertType
std::vector< Label > mMonomials