| 126 | {} |
| 127 | |
| 128 | bool LevenshteinDFA::Position::SubsumedBy(Position const & rhs) const |
| 129 | { |
| 130 | if (m_errorsLeft >= rhs.m_errorsLeft) |
| 131 | return false; |
| 132 | |
| 133 | auto const errorsAvail = rhs.m_errorsLeft - m_errorsLeft; |
| 134 | |
| 135 | if (IsStandard() && rhs.IsStandard()) |
| 136 | return AbsDiff(m_offset, rhs.m_offset) <= errorsAvail; |
| 137 | |
| 138 | if (IsStandard() && rhs.IsTransposed()) |
| 139 | return m_offset == rhs.m_offset && m_errorsLeft == 0; |
| 140 | |
| 141 | if (IsTransposed() && rhs.IsStandard()) |
| 142 | return AbsDiff(m_offset + 1, rhs.m_offset) <= errorsAvail; |
| 143 | |
| 144 | ASSERT(IsTransposed(), ()); |
| 145 | ASSERT(rhs.IsTransposed(), ()); |
| 146 | return m_offset == rhs.m_offset; |
| 147 | } |
| 148 | |
| 149 | bool LevenshteinDFA::Position::operator<(Position const & rhs) const |
| 150 | { |
no test coverage detected