Macaulay2 Engine
Loading...
Searching...
No Matches

◆ leftOverlaps()

void WordWithDataTable::leftOverlaps ( std::vector< Overlap > & newLeftOverlaps) const

Definition at line 492 of file WordTable.cpp.

493{
494 // word here is the last word in the dictionary.
495 // For left overlap: dictword is a word in the dictionary NOT word.
496 // For right overlap: dictword is any word in the dictionary.
497 // A left overlap: suffix(dictword) == prefix(word)
498 // A right overlap: prefix(dictword) == suffix(word).
499 // if dictword == word, a match will be a right overlap, NOT a left overlap.
500 // A returned triple:
501 // (left overlap):
502
503 int word_index = mMonomials.size()-1;
504 std::vector<int> overlap_indices;
505 for (int i=0; i<word_index; ++i)
506 {
507 if (mIndices[i] == -1) continue;
508 overlap_indices.clear();
509 overlaps(mMonomials[i], mMonomials[word_index], overlap_indices);
510 for (auto j : overlap_indices)
511 newLeftOverlaps.push_back(std::make_tuple(i, j, word_index,true));
512 }
513 // triples will be <dict word index, index into dict word where suffix starts, word_index>.
514}
static void overlaps(WordWithData word1, WordWithData word2, std::vector< int > &result_overlaps)
std::vector< int > mIndices
std::vector< WordWithData > mMonomials

References mIndices, mMonomials, and overlaps().