Skip to content
Snippets Groups Projects
Commit 2cf3d15d authored by Tomas Capek's avatar Tomas Capek Committed by Jan Trávníček
Browse files

Refactor GeneralizedLevenshteinMatchingAutomaton - change style of main cycle.

parent 85a0706a
No related branches found
No related tags found
No related merge requests found
...@@ -33,9 +33,9 @@ template < class SymbolType > ...@@ -33,9 +33,9 @@ template < class SymbolType >
automaton::EpsilonNFA < SymbolType, void, ext::pair<unsigned int, unsigned int> > GeneralizedLevenshteinMatchingAutomaton::construct(const string::LinearString < SymbolType > & pattern, unsigned int allowed_errors) { automaton::EpsilonNFA < SymbolType, void, ext::pair<unsigned int, unsigned int> > GeneralizedLevenshteinMatchingAutomaton::construct(const string::LinearString < SymbolType > & pattern, unsigned int allowed_errors) {
automaton::EpsilonNFA < SymbolType, void, ext::pair<unsigned int, unsigned int> > result = stringology::matching::LevenshteinMatchingAutomaton::construct(pattern, allowed_errors); automaton::EpsilonNFA < SymbolType, void, ext::pair<unsigned int, unsigned int> > result = stringology::matching::LevenshteinMatchingAutomaton::construct(pattern, allowed_errors);
   
for (unsigned int i = 0; i<pattern.getContent().size(); i++) { for (unsigned int j = 0; j<allowed_errors; j++) {
for (unsigned int j = 0; j<allowed_errors; j++) { for (unsigned int i = j; i<pattern.getContent().size(); i++) {
if (i>=j && i+1 < pattern.getContent().size()) { if (i+1 < pattern.getContent().size()) {
auto from = ext::make_pair(i, j); auto from = ext::make_pair(i, j);
auto transpose_state = ext::make_pair(pattern.getContent().size()+1+i, j); auto transpose_state = ext::make_pair(pattern.getContent().size()+1+i, j);
auto to = ext::make_pair(i+2, j+1); auto to = ext::make_pair(i+2, j+1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment