Advertisement
Guest User

Untitled

a guest
Apr 29th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. vector<string> searchWordmismatch(string s, mat& trie_matrix, int maxmis)
  2. {
  3. vector<string> words = {""};
  4. vector<double> mistakes = {0};
  5. vector<double> mistakes = {0};
  6. vector<string> words1;
  7. vector<double> mistakes1;
  8. int current_mistake;
  9. int current_node = 0;
  10. for ( int i = 0; i < s.length(); i++ )
  11. {
  12. if (i%2 == 0) {
  13. for (int j = 0; j < words.length(); j++) {
  14. for (int k = 0; k < 4; k++) {
  15. if (trie_matrix(letter_index(s[i]), current_node) == 0) {
  16. current_mistake = 1;
  17. }
  18. else {
  19. current_mistake = 0;
  20. }
  21. if ((mistakes[j] + current_mistake) <= maxmis) {
  22. words.pushback(strcat(words[j], index_letter(k)))
  23.  
  24. }
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement