Skip to content
Permalink
Browse files

Use dotify.api v5.0.0 and dotify.common v4.4.0

  • Loading branch information...
joeha480 committed May 29, 2019
1 parent bd2e5ad commit 9871ffe4266c09f03231912d04762c2280060655
@@ -84,23 +84,23 @@ dependencies {
compileOnly 'org.osgi:org.osgi.service.component.annotations:1.3.0'

compile 'org.daisy.streamline:streamline-cli:1.0.0'
compile ('org.daisy.braille:braille-utils.pef-tools:5.0.2') {
compile ('org.daisy.braille:braille-utils.pef-tools:6.0.0') {
exclude module: 'Saxon-HE'
}
compile 'org.daisy.dotify:dotify.api:4.6.0'
compile 'org.daisy.dotify:dotify.common:4.3.1'
compile 'org.daisy.dotify:dotify.api:5.0.0'
compile 'org.daisy.dotify:dotify.common:4.4.0'
compile ('org.daisy.streamline:streamline-engine:1.3.0') {
exclude module: 'streamline-api'
}
compile 'org.daisy.streamline:streamline-api:1.3.0'

runtimeOnly 'org.daisy.braille:braille-utils.impl:6.0.0'
runtimeOnly ('org.daisy.dotify:dotify.formatter.impl:4.6.0') {
runtimeOnly 'org.daisy.braille:braille-utils.impl:7.0.0'
runtimeOnly ('org.daisy.dotify:dotify.formatter.impl:5.0.0') {
exclude module: 'Saxon-HE'
}
runtimeOnly 'org.daisy.dotify:dotify.hyphenator.impl:4.0.0'
runtimeOnly 'org.daisy.dotify:dotify.text.impl:4.0.0'
runtimeOnly 'org.daisy.dotify:dotify.translator.impl:4.2.0'
runtimeOnly 'org.daisy.dotify:dotify.hyphenator.impl:5.0.0'
runtimeOnly 'org.daisy.dotify:dotify.text.impl:5.0.0'
runtimeOnly 'org.daisy.dotify:dotify.translator.impl:5.0.0'
runtimeOnly ('org.daisy.dotify:dotify.task.impl:4.7.0') {
exclude module: 'Saxon-HE'
exclude module: 'streamline-api'
@@ -7,10 +7,11 @@

import org.daisy.dotify.api.translator.BrailleFilter;
import org.daisy.dotify.api.translator.BrailleFilterFactoryMakerService;
import org.daisy.dotify.api.translator.BrailleTranslatorFactory;
import org.daisy.dotify.api.translator.Translatable;
import org.daisy.dotify.api.translator.TranslationException;
import org.daisy.dotify.api.translator.TranslatorConfigurationException;
import org.daisy.dotify.api.translator.TranslatorMode;
import org.daisy.dotify.api.translator.TranslatorType;
import org.junit.Test;

@SuppressWarnings("javadoc")
@@ -31,7 +32,7 @@ public void testFilterFactory() {
public void testSwedishUncontractedFilter_01() throws TranslatorConfigurationException, TranslationException {
//Setup
BrailleFilterFactoryMakerService filterFactory = getBrailleFilterFMS();
BrailleFilter bt = filterFactory.newFilter("sv-SE", BrailleTranslatorFactory.MODE_UNCONTRACTED);
BrailleFilter bt = filterFactory.newFilter("sv-SE", TranslatorMode.withType(TranslatorType.UNCONTRACTED).toString());
//Test
assertNotNull(bt);
assertEquals("⠼⠁⠃⠉", bt.filter(Translatable.text("123").build()));
@@ -41,7 +42,7 @@ public void testSwedishUncontractedFilter_01() throws TranslatorConfigurationExc
public void testSwedishUncontractedFilter_02() throws TranslatorConfigurationException, TranslationException {
//Setup
BrailleFilterFactoryMakerService filterFactory = getBrailleFilterFMS();
BrailleFilter bt = filterFactory.newFilter("sv-SE", BrailleTranslatorFactory.MODE_UNCONTRACTED);
BrailleFilter bt = filterFactory.newFilter("sv-SE", TranslatorMode.withType(TranslatorType.UNCONTRACTED).toString());
//Test
assertNotNull(bt);
assertEquals("⠁⠧\u00ad⠎⠞⠁⠧\u00ad⠝⠊⠝⠛⠎\u00ad⠗⠑⠛\u00ad⠇⠑⠗", bt.filter(Translatable.text("avstavningsregler").hyphenate(true).build()));
@@ -6,11 +6,12 @@
import static org.junit.Assert.assertTrue;

import org.daisy.dotify.api.translator.BrailleTranslator;
import org.daisy.dotify.api.translator.BrailleTranslatorFactory;
import org.daisy.dotify.api.translator.BrailleTranslatorFactoryMakerService;
import org.daisy.dotify.api.translator.Translatable;
import org.daisy.dotify.api.translator.TranslationException;
import org.daisy.dotify.api.translator.TranslatorConfigurationException;
import org.daisy.dotify.api.translator.TranslatorMode;
import org.daisy.dotify.api.translator.TranslatorType;
import org.junit.Test;

@SuppressWarnings("javadoc")
@@ -31,7 +32,7 @@ public void testTranslatorFactory() {
public void testSwedishUncontractedTranslator() throws TranslatorConfigurationException, TranslationException {
//Setup
BrailleTranslatorFactoryMakerService translatorFactory = getBrailleTranslatorFMS();
BrailleTranslator bt = translatorFactory.newTranslator("sv-SE", BrailleTranslatorFactory.MODE_UNCONTRACTED);
BrailleTranslator bt = translatorFactory.newTranslator("sv-SE", TranslatorMode.withType(TranslatorType.UNCONTRACTED).toString());
//Test
assertNotNull(bt);
assertEquals("⠼⠁⠃⠉", bt.translate(Translatable.text("123").build()).getTranslatedRemainder());
@@ -41,7 +42,7 @@ public void testSwedishUncontractedTranslator() throws TranslatorConfigurationEx
public void testEnglishBypassTranslator() throws TranslatorConfigurationException, TranslationException {
// Setup
BrailleTranslatorFactoryMakerService translatorFactory = getBrailleTranslatorFMS();
BrailleTranslator bt = translatorFactory.newTranslator("en", BrailleTranslatorFactory.MODE_BYPASS);
BrailleTranslator bt = translatorFactory.newTranslator("en", TranslatorMode.withType(TranslatorType.BYPASS).toString());
// Test
assertNotNull(bt);
assertEquals("123", bt.translate(Translatable.text("123").build()).getTranslatedRemainder());
@@ -39,7 +39,7 @@ public void testSupportedSpecifications() {
assertTrue(specs.contains(TaskGroupInformation.newConvertBuilder("text", "html").build()));
assertTrue(specs.contains(TaskGroupInformation.newConvertBuilder("txt", "html").build()));
assertTrue(specs.contains(TaskGroupInformation.newConvertBuilder("epub", "html").build()));
assertTrue(specs.contains(TaskGroupInformation.newConvertBuilder("obfl", "text").build()));
assertTrue(specs.contains(TaskGroupInformation.newConvertBuilder("obfl", "formatted-text").build()));

assertTrue(specs.contains(TaskGroupInformation.newConvertBuilder("dtbook", "obfl").build()));
assertTrue(specs.contains(TaskGroupInformation.newConvertBuilder("xml", "obfl").build()));
@@ -107,6 +107,6 @@ public void testGetFactoryForEnglish() throws TaskSystemFactoryException {
TaskSystemFactoryMakerService factory = getTaskSystemFMS();

//Test
assertNotNull(factory.getFactory("xml", "text", "en-US"));
assertNotNull(factory.getFactory("xml", "formatted-text", "en-US"));
}
}
@@ -21,26 +21,26 @@ public static Option brailleUtilsCore() {
dotifyApi(),
MavenRepo.CENTRAL.get("org.daisy.libs", "jing", "20120724.0.0"),
MavenRepo.CENTRAL.get("org.daisy.libs", "saxon-he", "9.5.1.5"),
MavenRepo.CENTRAL.get("org.daisy.braille", "braille-utils.pef-tools", "5.0.2")
MavenRepo.CENTRAL.get("org.daisy.braille", "braille-utils.pef-tools", "6.0.0")
);
}

public static Option brailleUtilsCatalog() {
return MavenRepo.CENTRAL.get("org.daisy.braille", "braille-utils.impl", "6.0.0");
return MavenRepo.CENTRAL.get("org.daisy.braille", "braille-utils.impl", "7.0.0");
}

static Option dotifyApi() {
return MavenRepo.SONATYPE_STAGING.get("org.daisy.dotify", "dotify.api", "4.7.0");
return MavenRepo.CENTRAL.get("org.daisy.dotify", "dotify.api", "5.0.0");
}

static Option dotifyCommon() {
return MavenRepo.CENTRAL.get("org.daisy.dotify", "dotify.common", "4.3.1");
return MavenRepo.CENTRAL.get("org.daisy.dotify", "dotify.common", "4.4.0");
}

public static Option dotifyText() {
return composite(
dotifyApi(),
MavenRepo.CENTRAL.get("org.daisy.dotify", "dotify.text.impl", "4.0.0")
MavenRepo.CENTRAL.get("org.daisy.dotify", "dotify.text.impl", "5.0.0")
);
}

@@ -53,7 +53,7 @@ public static Option dotifyHyphenator() {
dotifyApi(),
dotifyCommon(),
texhyphj(),
MavenRepo.CENTRAL.get("org.daisy.dotify", "dotify.hyphenator.impl", "4.0.0")
MavenRepo.CENTRAL.get("org.daisy.dotify", "dotify.hyphenator.impl", "5.0.0")
);
}

@@ -62,12 +62,12 @@ public static Option dotifyTranslator() {
dotifyHyphenator(),
MavenRepo.CENTRAL.get("net.java.dev.jna", "jna", "5.2.0"),
MavenRepo.CENTRAL.get("org.liblouis", "liblouis-java", "4.1.0"),
MavenRepo.SONATYPE_STAGING.get("org.daisy.dotify", "dotify.translator.impl", "4.2.0")
MavenRepo.CENTRAL.get("org.daisy.dotify", "dotify.translator.impl", "5.0.0")
);
}

static Option streamlineApi() {
return MavenRepo.CENTRAL.get("org.daisy.streamline", "streamline-api", "1.3.0");
return MavenRepo.CENTRAL.get("org.daisy.streamline", "streamline-api", "1.4.0");
}

static Option jing() {
@@ -98,7 +98,7 @@ public static Option dotifyFormatter() {
dotifyTranslator(),
wstx(),
saxon(),
MavenRepo.SONATYPE_STAGING.get("org.daisy.dotify", "dotify.formatter.impl", "4.6.0")
MavenRepo.CENTRAL.get("org.daisy.dotify", "dotify.formatter.impl", "5.0.0")
);
}

@@ -117,7 +117,7 @@ public static Option streamlineEngine() {
return composite(
dotifyCommon(),
streamlineApi(),
MavenRepo.SONATYPE_STAGING.get("org.daisy.streamline", "streamline-engine", "1.3.0")
MavenRepo.CENTRAL.get("org.daisy.streamline", "streamline-engine", "1.3.0")
);
}

@@ -3,8 +3,9 @@
import static org.junit.Assert.assertNotNull;

import org.daisy.dotify.api.formatter.Formatter;
import org.daisy.dotify.api.translator.BrailleTranslatorFactory;
import org.daisy.dotify.api.formatter.FormatterFactoryMaker;
import org.daisy.dotify.api.translator.TranslatorMode;
import org.daisy.dotify.api.translator.TranslatorType;
import org.junit.Test;


@@ -22,7 +23,7 @@ public void testFactory() {
@Test
public void testSwedishFormatter() {
//setup
Formatter f = FormatterFactoryMaker.newInstance().newFormatter("sv-SE", BrailleTranslatorFactory.MODE_UNCONTRACTED);
Formatter f = FormatterFactoryMaker.newInstance().newFormatter("sv-SE", TranslatorMode.withType(TranslatorType.UNCONTRACTED).toString());
//test
assertNotNull("Assert that formatter can be instantiated", f);
}

This file was deleted.

@@ -6,12 +6,13 @@
import java.util.HashMap;
import java.util.Map;

import org.daisy.dotify.api.translator.BrailleTranslatorFactory;
import org.daisy.dotify.api.translator.TextBorderConfigurationException;
import org.daisy.dotify.api.translator.TextBorderFactory;
import org.daisy.dotify.api.translator.TextBorderFactoryMaker;
import org.daisy.dotify.api.translator.TextBorderFactoryMakerService;
import org.daisy.dotify.api.translator.TextBorderStyle;
import org.daisy.dotify.api.translator.TextBorderFactoryMaker;
import org.daisy.dotify.api.translator.TranslatorMode;
import org.daisy.dotify.api.translator.TranslatorType;
import org.junit.Test;

@SuppressWarnings("javadoc")
@@ -22,7 +23,7 @@ public void testUnknownFactory() throws TextBorderConfigurationException {
//Setup
TextBorderFactoryMakerService maker = TextBorderFactoryMaker.newInstance();
Map<String, Object> props = new HashMap<String, Object>();
props.put(TextBorderFactory.FEATURE_MODE, BrailleTranslatorFactory.MODE_UNCONTRACTED);
props.put(TextBorderFactory.FEATURE_MODE, TranslatorMode.withType(TranslatorType.UNCONTRACTED).toString());
//Test
maker.newTextBorderStyle(props);
}
@@ -32,7 +33,7 @@ public void testKnownFactory() throws TextBorderConfigurationException {
//Setup
TextBorderFactoryMakerService maker = TextBorderFactoryMaker.newInstance();
Map<String, Object> props = new HashMap<String, Object>();
props.put(TextBorderFactory.FEATURE_MODE, BrailleTranslatorFactory.MODE_UNCONTRACTED);
props.put(TextBorderFactory.FEATURE_MODE, TranslatorMode.withType(TranslatorType.UNCONTRACTED).toString());
props.put("border-style", "solid");
props.put("border-width", "1");
props.put("border-align", "outer");
@@ -48,7 +48,7 @@
private static final HashMap<String, String> extensionBindings;
static {
extensionBindings = new HashMap<String, String>();
extensionBindings.put("txt", SystemKeys.TEXT_FORMAT);
extensionBindings.put("txt", SystemKeys.FORMATTED_TEXT_FORMAT);
}

private final boolean writeTempFiles;
@@ -37,7 +37,7 @@


public static final String PEF_FORMAT = "pef";
public static final String TEXT_FORMAT = "text";
public static final String FORMATTED_TEXT_FORMAT = "formatted-text";
public static final String OBFL_FORMAT = "obfl";

/**
@@ -146,7 +146,7 @@ public static void main(String[] args) throws InternalTaskException, IOException
ExitCode.MISSING_ARGUMENT.exitSystem(SystemKeys.OUTPUT_FORMAT + " must be specified in batch mode.");
} else if (format.equals(SystemKeys.PEF_FORMAT)) {
format = "pef";
} else if (format.equals(SystemKeys.TEXT_FORMAT)) {
} else if (format.equals(SystemKeys.FORMATTED_TEXT_FORMAT)) {
format = "txt";
} else if (format.equals(SystemKeys.OBFL_FORMAT)) {
format = "obfl";
@@ -301,7 +301,7 @@ public String getDescription() {
{
ArrayList<Definition> vals = new ArrayList<Definition>();
vals.add(new Definition(SystemKeys.PEF_FORMAT, "write result in PEF-format"));
vals.add(new Definition(SystemKeys.TEXT_FORMAT, "write result as text"));
vals.add(new Definition(SystemKeys.FORMATTED_TEXT_FORMAT, "write result as text"));
//vals.add(new Definition(SystemKeys.OBFL_FORMAT, "write result in OBFL-format (bypass formatter)"));
optionalArgs.add(new OptionalArgument(SystemKeys.OUTPUT_FORMAT, "Specifies output format", vals, "[detect]"));
}

0 comments on commit 9871ffe

Please sign in to comment.
You can’t perform that action at this time.