-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated translation from letter algorithm
- Deleted un-needed struct from mors.h - Program now works on release mode.
- Loading branch information
Showing
9 changed files
with
56 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
-.../.-/-.../.- | ||
.... . .-.. .-.. --- / .-- --- .-. .-.. -.. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
|/ | ||
A|.- | ||
B|-... | ||
C|-.-. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,17 @@ | ||
#include "translate.h" | ||
#include "translate.h" | ||
|
||
std::string translate::MLetterToString(const std::vector<std::shared_ptr<MLetter>>& Letters){ | ||
std::string result = ""; | ||
for(auto letter : Letters){ | ||
int i = 0; | ||
for(auto def : MDefImporter::getDefinitions()){ | ||
if(MLetter::isEqualTo(letter, def.second)){ | ||
result.append(def.first); | ||
}else{ | ||
i++; | ||
} | ||
} | ||
if(i == MDefImporter::getDefinitions().size()) result.append("*"); | ||
} | ||
return result; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,19 @@ | ||
#ifndef H_TRANSLATE | ||
#define H_TRANSLATE | ||
|
||
#include <vector> | ||
#include <iostream> | ||
#include <memory> | ||
#include "../structure/mors.h" | ||
#include "../defs/definition_importer.h" | ||
|
||
class translate{ | ||
|
||
}; | ||
public: | ||
/* | ||
TO BE IMPLEMENTED / INEFFICIENT | ||
Large amounts of morse code will take a long time and/or crash. | ||
*/ | ||
static std::string MLetterToString(const std::vector<std::shared_ptr<MLetter>>& Letters); | ||
}; | ||
|
||
#endif |