Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vector<string> searchWordmismatch(string s, mat& trie_matrix, int maxmis)
- {
- vector<string> words = {""};
- vector<double> mistakes = {0};
- vector<double> mistakes = {0};
- vector<string> words1;
- vector<double> mistakes1;
- int current_mistake;
- int current_node = 0;
- for ( int i = 0; i < s.length(); i++ )
- {
- if (i%2 == 0) {
- for (int j = 0; j < words.length(); j++) {
- for (int k = 0; k < 4; k++) {
- if (trie_matrix(letter_index(s[i]), current_node) == 0) {
- current_mistake = 1;
- }
- else {
- current_mistake = 0;
- }
- if ((mistakes[j] + current_mistake) <= maxmis) {
- words.pushback(strcat(words[j], index_letter(k)))
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement