void KeyCodeConverter::initIntervals() { initInterval(97, 122, VK_A); //65 == VK_A initInterval(65, 90, VK_A); //initInterval(48, 57, VK_NUMPAD0); //VK_0 == 48 initInterval(48, 57, VK_0); //VK_0 == 48 }
// Find the interval in pBWT corresponding to w // If w does not exist in the BWT, the interval // coordinates [l, u] will be such that l > u BWTInterval BWTAlgorithms::findInterval(const BWT* pBWT, const std::string& w) { int len = w.size(); int j = len - 1; char curr = w[j]; BWTInterval interval; initInterval(interval, curr, pBWT); --j; for(;j >= 0; --j) { curr = w[j]; updateInterval(interval, curr, pBWT); if(!interval.isValid()) return interval; } return interval; }