-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ac2062a
commit 176b913
Showing
5 changed files
with
93 additions
and
29 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
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
49 changes: 49 additions & 0 deletions
49
...ges/server/src/main/java/software/uncharted/terarium/hmiserver/utils/GreekDictionary.java
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package software.uncharted.terarium.hmiserver.utils; | ||
|
||
import com.google.common.collect.BiMap; | ||
import com.google.common.collect.HashBiMap; | ||
|
||
/** | ||
* A class to store the Greek alphabet in a BiMap | ||
* | ||
* englishToGreek("beta")); // Output: β | ||
* greekToEnglish("β")); // Output: beta | ||
*/ | ||
public class GreekDictionary { | ||
private static BiMap<String, String> englishGreek = HashBiMap.create(); | ||
static { | ||
englishGreek.put("alpha", "α"); | ||
englishGreek.put("beta", "β"); | ||
englishGreek.put("gamma", "γ"); | ||
englishGreek.put("delta", "δ"); | ||
englishGreek.put("epsilon", "ε"); | ||
englishGreek.put("zeta", "ζ"); | ||
englishGreek.put("eta", "η"); | ||
englishGreek.put("theta", "θ"); | ||
englishGreek.put("iota", "ι"); | ||
englishGreek.put("kappa", "κ"); | ||
englishGreek.put("lambda", "λ"); | ||
englishGreek.put("mu", "μ"); | ||
englishGreek.put("nu", "ν"); | ||
englishGreek.put("xi", "ξ"); | ||
englishGreek.put("omicron", "ο"); | ||
englishGreek.put("pi", "π"); | ||
englishGreek.put("rho", "ρ"); | ||
englishGreek.put("sigma", "σ"); | ||
englishGreek.put("tau", "τ"); | ||
englishGreek.put("upsilon", "υ"); | ||
englishGreek.put("phi", "φ"); | ||
englishGreek.put("chi", "χ"); | ||
englishGreek.put("psi", "ψ"); | ||
englishGreek.put("omega", "ω"); | ||
} | ||
|
||
public static String englishToGreek(String english) { | ||
return englishGreek.get(english); | ||
} | ||
public static String greekToEnglish(String greek) { | ||
return englishGreek.inverse().get(greek); | ||
} | ||
} | ||
|
||
|