Skip to content
Snippets Groups Projects
Commit e273e32b authored by Andrey Ruzhanskiy's avatar Andrey Ruzhanskiy
Browse files

Added liblouis to build.gradle.

parent 02a7b07d
No related branches found
No related tags found
1 merge request!24Feat/brailletextrasterizer 38
......@@ -39,6 +39,7 @@ dependencies {
compile group: 'javax.measure', name: 'unit-api', version: '2.0-PRD'
compile group: 'tec.units', name: 'unit-ri', version: '1.0.3'
compile 'org.liblouis:liblouis-java:4.2.0'
// CSV parsing
compile "com.opencsv:opencsv:4.6"
}
......
......@@ -7,6 +7,13 @@ import de.tudresden.inf.mci.brailleplot.layout.RasterCanvas;
//import de.tudresden.inf.mci.brailleplot.printabledata.SimpleMatrixDataImpl;
import de.tudresden.inf.mci.brailleplot.layout.Rectangle;
import de.tudresden.inf.mci.brailleplot.printerbackend.NotSupportedFileExtensionException;
import org.liblouis.CompilationException;
import org.liblouis.DisplayException;
import org.liblouis.DisplayTable;
import org.liblouis.TranslationException;
import org.liblouis.TranslationResult;
import org.liblouis.Translator;
import org.liblouis.Typeform;
import java.util.Objects;
......@@ -45,6 +52,12 @@ public final class BrailleTextRasterizer implements Rasterizer<BrailleText> {
@Override
public void rasterize(final BrailleText data, final RasterCanvas canvas) throws InsufficientRenderingAreaException {
Translator translator = null;
String test = "123";
String testA = "";
TranslationResult result = null;
System.out.println(testMethod());
Rectangle rect = data.getArea().intersectedWith(canvas.getDotRectangle());
mCanvas = canvas;
String[] letterAsBraille;
......@@ -80,6 +93,22 @@ public final class BrailleTextRasterizer implements Rasterizer<BrailleText> {
}
}
public String testMethod() {
TranslationResult result = null;
TranslationResult wrongResult = null;
try {
// Translator translator = new Translator("C:\\Users\\tEST\\Desktop\\FPMCI\\brailleplot\\src\\main\\resources\\mapping\\tables\\de-de-comp8.ctb");
// result = translator.translate("ABCD",null,null,null, DisplayTable.StandardDisplayTables.DEFAULT);
// translator = Translator.find("locale: de");
Translator wrongTranslator = new Translator("src\\main\\resources\\mapping\\tables\\de.utb");
wrongResult = wrongTranslator.translate("123", null, null, null, DisplayTable.StandardDisplayTables.DEFAULT);
} catch (Exception e) {
e.printStackTrace();
}
//System.out.println(wrongResult.getBraille());
return wrongResult.getBraille();
}
// TODO Get Liblouis
private boolean checkForNumbers(String possibleNumber) {
if (possibleNumber.matches("[0-9]")) {
......
......@@ -181,7 +181,7 @@ final class UniformTextureBarChartRasterizer implements Rasterizer<BarChart> {
xAxis.setBoundary(xAxisBound);
// a bit more complicated than y-axis here: building a map for the axis labels
Map<Integer, String> xAxisLabels = new HashMap<>();
char labelLetter = 'A';
char labelLetter = 'a';
for (int axisTick = (negUnits / 2) * -1; axisTick <= (posUnits / 2); axisTick++) {
xAxisLabels.put(axisTick, Character.toString(labelLetter));
labelLetter++;
......
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