diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index e8a43fc8..58481fcd 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -12,7 +12,7 @@ on: jobs: build: - runs-on: macos-13 + runs-on: macos-latest steps: - name: Checkout repository diff --git a/README.md b/README.md index bc993341..77ee2e59 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,13 @@ mavenized [JSR-113](https://jcp.org/en/jsr/detail?id=113) modified aka JSAPI2 - * this JSAPI version 2.2.1 (**CAUTION** since 2.2.0, versions are my original (modified from SUN's original)) + * this JSAPI version 2.2.1 (**CAUTION**: starting from version 2.2.0, these are my own versions, modified from SUN's original.) * 2.0.6 * DOES NOT support the J2ME platform (like CLDC 1.0, MIDP 1.0) * volume property is enabled * 2.2.0 support service loader mechanism. - * `speech.properties` and `EngineManager#registerEngineListFactory` works, but no more needed - * 2.2.1 add voice comparison level for `SpeechLocal#match()` + * `speech.properties` and `EngineManager#registerEngineListFactory` work, but no longer needed + * 2.2.1 add voice comparison level for [`SpeechLocal#match()`](javax.speech/src/main/java/javax/speech/SpeechLocale.java) ## Install diff --git a/javax.speech/pom.xml b/javax.speech/pom.xml index f62c889d..e0eb1060 100644 --- a/javax.speech/pom.xml +++ b/javax.speech/pom.xml @@ -6,7 +6,7 @@ org.jvoicexml jsapi2 - 0.6.10 + 0.6.11 javax.speech diff --git a/javax.speech/src/main/java/javax/speech/EngineManager.java b/javax.speech/src/main/java/javax/speech/EngineManager.java index 86027fe4..c303a27c 100644 --- a/javax.speech/src/main/java/javax/speech/EngineManager.java +++ b/javax.speech/src/main/java/javax/speech/EngineManager.java @@ -49,7 +49,7 @@ * The EngineManager provides the ability to * locate, select and create speech Engine instances. *

- * The createEngine method creates create speech Engines. + * The createEngine method creates speech Engines. * It accepts a single parameter that * defines the required properties for the Engine to create. * The parameter is a subclass of EngineMode corresponding to a @@ -92,7 +92,7 @@ * Locale is treated specially in the selection to ensure that language is * always considered when selecting an engine. * If a locale is not provided, the default locale - * (java.util.Locale.getDefault) is used. + * ({@code java.util.Locale.getDefault}) is used. *

* The selection procedure is: *

@@ -109,7 +109,7 @@ * the required properties. * Amongst the matching engines, give preference to: *

- * A running engine (EngineMode.getRunning is true), + * A running engine ({@link EngineMode#getRunning} is true), * An engine that matches the default Locale's country. *

* When more than one engine is a legal match in the final step, @@ -149,8 +149,8 @@ * *

* This line is interpreted as "the EngineListFactory object for the - * com.acme.recognizer engine is the class called - * com.acme.recognizer.AcmeEngineListFactory. + * {@code com.acme.recognizer} engine is the class called + * {@code com.acme.recognizer.AcmeEngineListFactory}. * When it is first called, the EngineManager class will attempt to create an * instance of each EngineListFactory object and will ensure that it implements * the EngineListFactory interface. @@ -186,7 +186,7 @@ public class EngineManager { Class clazz = Class.forName("javax.speech.EngineManager"); input = clazz.getResourceAsStream("/speech.properties"); } catch (ClassNotFoundException e) { - throw new IllegalArgumentException(e.getMessage()); + throw new IllegalArgumentException(e); } if (input != null) { Properties props = new Properties(); @@ -196,7 +196,7 @@ public class EngineManager { // Close input input.close(); } catch (IOException e) { - // Ignore. + logger.log(Level.DEBUG, e.getMessage(), e); } Enumeration keys = props.keys(); @@ -206,7 +206,7 @@ public class EngineManager { try { registerEngineListFactory(className); } catch (IllegalArgumentException | SecurityException | EngineException e) { - // Ignore. + logger.log(Level.DEBUG, e.getMessage(), e); } } } @@ -217,7 +217,7 @@ public class EngineManager { * Lists EngineMode objects for available engine modes * that match the required properties. *

- * If the require parameter is null, then all known Engines are listed. + * If the {@code require} parameter is null, then all known Engines are listed. *

* Returns a zero-length list if no Engines are available or if no Engines * have the required properties. (The method never returns null). diff --git a/javax.speech/src/main/java/javax/speech/SpeechLocale.java b/javax.speech/src/main/java/javax/speech/SpeechLocale.java index 7980c344..dd0bfc85 100644 --- a/javax.speech/src/main/java/javax/speech/SpeechLocale.java +++ b/javax.speech/src/main/java/javax/speech/SpeechLocale.java @@ -26,7 +26,6 @@ package javax.speech; - import java.lang.System.Logger; import java.lang.System.Logger.Level; @@ -35,9 +34,10 @@ /** * TODO this class should be replaced by Locale? + *

* system property *

  • javax.speech.SpeechLocale.comparisonStrictness ... set strictness for #match() method values are - * STRICT
  • + * LENIENT or STRICT (default) * * @since 2.0.6 */ @@ -66,18 +66,18 @@ public final class SpeechLocale { FRENCH = new SpeechLocale("fr"); GERMAN = new SpeechLocale("de"); - String defaultLanguage = System.getProperty("microedition.locale"); + String defaultLanguage = System.getProperty("microedition.locale"); // TODO cldc is deprecated if (defaultLanguage == null) { defaultLanguage = "en"; } DEFAULT_LOCALE = new SpeechLocale(defaultLanguage); } - private String language; + private final String language; - private String country; + private final String country; - private String variant; + private final String variant; /** * Convert new iso639 codes to the old ones. @@ -85,7 +85,7 @@ public final class SpeechLocale { * @param language the language to check * @return the appropriate code */ - private String convertLanguage(String language) { + private static String convertLanguage(String language) { if (language.isEmpty()) return language; language = language.toLowerCase(); @@ -117,14 +117,17 @@ public static SpeechLocale[] getAvailableLocales() { return new SpeechLocale[] {ENGLISH, US, FRENCH, GERMAN}; } + /** @return not null */ public String getLanguage() { return language; } + /** @return not null */ public String getCountry() { return country; } + /** @return not null */ public String getVariant() { return variant; } @@ -139,9 +142,12 @@ public int hashCode() { return result; } - /** for {@link #match(SpeechLocale)} */ + /** + * for {@link #match(SpeechLocale)} + * @since 2.2.1 + */ private enum ComparisonStrictness { - /** match if on of them is matched */ + /** match if specified ones are matched */ LENIENT, /** compare all */ STRICT; @@ -198,6 +204,10 @@ public boolean equals(Object obj) { } /** + * when {@link #comparisonStrictness} is {@link ComparisonStrictness#STRICT} it's needed perfect match + * (country & language & variant), when {@link #comparisonStrictness} is {@link ComparisonStrictness#LENIENT} + * it's needed language & country (if it's specified). + * * @since 2.2.1 using {@link #comparisonStrictness} for comparison strictness. * @param require null means any match */ diff --git a/org.jvoicexml.jsapi2.demo.helloworld/pom.xml b/org.jvoicexml.jsapi2.demo.helloworld/pom.xml index ef6b267e..af96273c 100644 --- a/org.jvoicexml.jsapi2.demo.helloworld/pom.xml +++ b/org.jvoicexml.jsapi2.demo.helloworld/pom.xml @@ -6,7 +6,7 @@ org.jvoicexml jsapi2 - 0.6.10 + 0.6.11 org.jvoicexml.jsapi2.demo.helloworld @@ -20,7 +20,6 @@ false -Djava.util.logging.config.file=${project.build.testOutputDirectory}/logging.properties - -Dvavi.util.logging.VaviFormatter.extraClassMethod=sun\.util\.logging\.internal\.LoggingProviderImpl\$JULWrapper#log @@ -38,17 +37,17 @@ org.jvoicexml javax.speech - 0.6.10 + 0.6.11 org.jvoicexml org.jvoicexml.jsapi2 - 0.6.10 + 0.6.11 org.jvoicexml org.jvoicexml.jsapi2.freetts - 0.6.10 + 0.6.11 com.github.umjammer diff --git a/org.jvoicexml.jsapi2.demo.helloworld/src/test/resources/logging.properties b/org.jvoicexml.jsapi2.demo.helloworld/src/test/resources/logging.properties index f27c4c6a..e9e4805f 100644 --- a/org.jvoicexml.jsapi2.demo.helloworld/src/test/resources/logging.properties +++ b/org.jvoicexml.jsapi2.demo.helloworld/src/test/resources/logging.properties @@ -3,4 +3,6 @@ handlers=java.util.logging.ConsoleHandler java.util.logging.ConsoleHandler.level=ALL java.util.logging.ConsoleHandler.formatter=vavi.util.logging.VaviFormatter +vavi.util.logging.VaviFormatter.extraClassMethod=sun\.util\.logging\.internal\.LoggingProviderImpl\$JULWrapper#log + org.jvoicexml.jsapi2.level=ALL diff --git a/org.jvoicexml.jsapi2.demo.input/pom.xml b/org.jvoicexml.jsapi2.demo.input/pom.xml index a0943142..eb9e518d 100644 --- a/org.jvoicexml.jsapi2.demo.input/pom.xml +++ b/org.jvoicexml.jsapi2.demo.input/pom.xml @@ -6,7 +6,7 @@ org.jvoicexml jsapi2 - 0.6.10 + 0.6.11 org.jvoicexml.jsapi2.demo.input @@ -37,22 +37,22 @@ org.jvoicexml javax.speech - 0.6.10 + 0.6.11 org.jvoicexml org.jvoicexml.jsapi2 - 0.6.10 + 0.6.11 org.jvoicexml org.jvoicexml.jsapi2.freetts - 0.6.10 + 0.6.11 org.jvoicexml org.jvoicexml.jsapi2.sphinx4 - 0.6.10 + 0.6.11 diff --git a/org.jvoicexml.jsapi2.demo.rtp/pom.xml b/org.jvoicexml.jsapi2.demo.rtp/pom.xml index 0ada6e1c..988c8691 100644 --- a/org.jvoicexml.jsapi2.demo.rtp/pom.xml +++ b/org.jvoicexml.jsapi2.demo.rtp/pom.xml @@ -6,7 +6,7 @@ org.jvoicexml jsapi2 - 0.6.10 + 0.6.11 org.jvoicexml.jsapi2.demo.rtp @@ -37,17 +37,17 @@ org.jvoicexml javax.speech - 0.6.10 + 0.6.11 org.jvoicexml org.jvoicexml.jsapi2 - 0.6.10 + 0.6.11 org.jvoicexml org.jvoicexml.jsapi2.freetts - 0.6.10 + 0.6.11 diff --git a/org.jvoicexml.jsapi2.freetts/pom.xml b/org.jvoicexml.jsapi2.freetts/pom.xml index 6b1523ef..8d22be98 100644 --- a/org.jvoicexml.jsapi2.freetts/pom.xml +++ b/org.jvoicexml.jsapi2.freetts/pom.xml @@ -6,7 +6,7 @@ org.jvoicexml jsapi2 - 0.6.10 + 0.6.11 org.jvoicexml.jsapi2.freetts @@ -20,7 +20,6 @@ false -Djava.util.logging.config.file=${project.build.testOutputDirectory}/logging.properties - -Dvavi.util.logging.VaviFormatter.extraClassMethod=sun\.util\.logging\.internal\.LoggingProviderImpl\$JULWrapper#log @@ -38,13 +37,13 @@ org.mozilla rhino - 1.7.14 + runtime org.jvoicexml org.jvoicexml.jsapi2 - 0.6.10 + 0.6.11 ${freetts.groupId} diff --git a/org.jvoicexml.jsapi2.freetts/src/test/resources/logging.properties b/org.jvoicexml.jsapi2.freetts/src/test/resources/logging.properties index 2ef7e4aa..154af515 100644 --- a/org.jvoicexml.jsapi2.freetts/src/test/resources/logging.properties +++ b/org.jvoicexml.jsapi2.freetts/src/test/resources/logging.properties @@ -3,6 +3,8 @@ handlers=java.util.logging.ConsoleHandler java.util.logging.ConsoleHandler.level=ALL java.util.logging.ConsoleHandler.formatter=vavi.util.logging.VaviFormatter +vavi.util.logging.VaviFormatter.extraClassMethod=sun\.util\.logging\.internal\.LoggingProviderImpl\$JULWrapper#log + org.jvoicexml.jsapi2.level=ALL javax.speech.level=ALL #vavi.util.level=WARNING \ No newline at end of file diff --git a/org.jvoicexml.jsapi2.mac/pom.xml b/org.jvoicexml.jsapi2.mac/pom.xml index 8faa4bfe..b94d5469 100644 --- a/org.jvoicexml.jsapi2.mac/pom.xml +++ b/org.jvoicexml.jsapi2.mac/pom.xml @@ -20,7 +20,6 @@ true -Djava.util.logging.config.file=${project.build.testOutputDirectory}/logging.properties - -Dvavi.util.logging.VaviFormatter.extraClassMethod=sun\\.util\\.logging\\.internal\\.LoggingProviderImpl\\$JULWrapper#log @@ -38,7 +37,7 @@ org.mozilla rhino - 1.7.14 + runtime org.jvoicexml @@ -53,7 +52,7 @@ com.github.umjammer.rococoa rococoa-contrib - 0.8.7 + 0.8.13 diff --git a/org.jvoicexml.jsapi2.mac/src/main/java/org/jvoicexml/jsapi2/mac/rococoa/NSSpeechSynthesizer.java b/org.jvoicexml.jsapi2.mac/src/main/java/org/jvoicexml/jsapi2/mac/rococoa/NSSpeechSynthesizer.java index de6d05dd..4da520cf 100755 --- a/org.jvoicexml.jsapi2.mac/src/main/java/org/jvoicexml/jsapi2/mac/rococoa/NSSpeechSynthesizer.java +++ b/org.jvoicexml.jsapi2.mac/src/main/java/org/jvoicexml/jsapi2/mac/rococoa/NSSpeechSynthesizer.java @@ -506,7 +506,7 @@ public float getPitchBase() { * @param baselinePitch the baseline pitch to use */ public void setPitchBase(float baselinePitch) { - setProperty(SpeechProperty.PitchBaseProperty, NSNumber.of((double) baselinePitch)); // TODO float bug? + setProperty(SpeechProperty.PitchBaseProperty, NSNumber.of((double) baselinePitch)); } /** @@ -527,7 +527,7 @@ public void setPitchMod(float modulation) { if (modulation < 0.0f || modulation > 127.0f) { throw new IllegalArgumentException("Pitch modulation must be in the range 0.0 - 127.0"); } - setProperty(SpeechProperty.PitchModProperty, NSNumber.of((double) modulation)); // TODO float bug? + setProperty(SpeechProperty.PitchModProperty, NSNumber.of((double) modulation)); } /** diff --git a/org.jvoicexml.jsapi2.mac/src/test/java/org/jvoicexml/jsapi2/mac/synthesis/TestSynthesizer.java b/org.jvoicexml.jsapi2.mac/src/test/java/org/jvoicexml/jsapi2/mac/synthesis/TestSynthesizer.java index 836346aa..3321833e 100644 --- a/org.jvoicexml.jsapi2.mac/src/test/java/org/jvoicexml/jsapi2/mac/synthesis/TestSynthesizer.java +++ b/org.jvoicexml.jsapi2.mac/src/test/java/org/jvoicexml/jsapi2/mac/synthesis/TestSynthesizer.java @@ -29,9 +29,6 @@ @EnabledOnOs(OS.MAC) public final class TestSynthesizer { - static { - System.setProperty("vavi.util.logging.VaviFormatter.extraClassMethod", "sun\\.util\\.logging\\.internal\\..+#log"); - } /** The test object. */ private Synthesizer synthesizer; diff --git a/org.jvoicexml.jsapi2.mac/src/test/resources/logging.properties b/org.jvoicexml.jsapi2.mac/src/test/resources/logging.properties index 5d291713..68970689 100644 --- a/org.jvoicexml.jsapi2.mac/src/test/resources/logging.properties +++ b/org.jvoicexml.jsapi2.mac/src/test/resources/logging.properties @@ -3,3 +3,5 @@ handlers=java.util.logging.ConsoleHandler java.util.logging.ConsoleHandler.level=ALL java.util.logging.ConsoleHandler.formatter=vavi.util.logging.VaviFormatter java.util.logging.ConsoleHandler.encoding=UTF-8 + +vavi.util.logging.VaviFormatter.extraClassMethod=sun\.util\.logging\.internal\.LoggingProviderImpl\$JULWrapper#log|sun\.util\.logging\.internal\..+#log diff --git a/org.jvoicexml.jsapi2.sapi.jsapi2speechserverbridge/pom.xml b/org.jvoicexml.jsapi2.sapi.jsapi2speechserverbridge/pom.xml index b168b908..7b69832d 100644 --- a/org.jvoicexml.jsapi2.sapi.jsapi2speechserverbridge/pom.xml +++ b/org.jvoicexml.jsapi2.sapi.jsapi2speechserverbridge/pom.xml @@ -6,7 +6,7 @@ org.jvoicexml jsapi2 - 0.6.2-SNAPSHOT + 0.6.11-SNAPSHOT org.jvoicexml.jsapi2.sapi.jsapi2speechserverbridge diff --git a/org.jvoicexml.jsapi2.sapi/pom.xml b/org.jvoicexml.jsapi2.sapi/pom.xml index 3aa9cf99..a2f41b64 100644 --- a/org.jvoicexml.jsapi2.sapi/pom.xml +++ b/org.jvoicexml.jsapi2.sapi/pom.xml @@ -6,7 +6,7 @@ org.jvoicexml jsapi2 - 0.6.10 + 0.6.11 org.jvoicexml.jsapi2.sapi @@ -187,7 +187,7 @@ org.mozilla rhino - 1.7.14 + runtime @@ -204,7 +204,7 @@ org.jvoicexml org.jvoicexml.jsapi2 - 0.6.10 + 0.6.11 diff --git a/org.jvoicexml.jsapi2.sphinx4/pom.xml b/org.jvoicexml.jsapi2.sphinx4/pom.xml index b7959eed..1bc6cfd0 100644 --- a/org.jvoicexml.jsapi2.sphinx4/pom.xml +++ b/org.jvoicexml.jsapi2.sphinx4/pom.xml @@ -6,7 +6,7 @@ org.jvoicexml jsapi2 - 0.6.10 + 0.6.11 org.jvoicexml.jsapi2.sphinx4 @@ -38,7 +38,7 @@ org.mozilla rhino - 1.7.14 + runtime @@ -55,7 +55,7 @@ org.jvoicexml org.jvoicexml.jsapi2 - 0.6.10 + 0.6.11 diff --git a/org.jvoicexml.jsapi2/pom.xml b/org.jvoicexml.jsapi2/pom.xml index c293e726..7d930c80 100644 --- a/org.jvoicexml.jsapi2/pom.xml +++ b/org.jvoicexml.jsapi2/pom.xml @@ -6,7 +6,7 @@ org.jvoicexml jsapi2 - 0.6.10 + 0.6.11 org.jvoicexml.jsapi2 @@ -21,7 +21,6 @@ false -Djava.util.logging.config.file=${project.build.testOutputDirectory}/logging.properties - -Dvavi.util.logging.VaviFormatter.extraClassMethod=sun\.util\.logging\.internal\.LoggingProviderImpl\$JULWrapper#log @@ -39,12 +38,12 @@ org.mozilla rhino - 1.7.14 + runtime org.jvoicexml javax.speech - 0.6.10 + 0.6.11 diff --git a/org.jvoicexml.jsapi2/src/test/resources/logging.properties b/org.jvoicexml.jsapi2/src/test/resources/logging.properties index 13e99bda..ea1d9a82 100644 --- a/org.jvoicexml.jsapi2/src/test/resources/logging.properties +++ b/org.jvoicexml.jsapi2/src/test/resources/logging.properties @@ -3,6 +3,7 @@ handlers=java.util.logging.ConsoleHandler java.util.logging.ConsoleHandler.level=ALL java.util.logging.ConsoleHandler.formatter=vavi.util.logging.VaviFormatter +vavi.util.logging.VaviFormatter.extraClassMethod=sun\.util\.logging\.internal\.LoggingProviderImpl\$JULWrapper#log org.jvoicexml.jsapi2.level=ALL javax.speech.level=ALL diff --git a/pom.xml b/pom.xml index 15463408..c143758f 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ org.jvoicexml jsapi2 - 0.6.10 + 0.6.11 pom @@ -47,7 +47,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.11.0 + 3.12.1 17 @@ -55,7 +55,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.2.2 + 3.2.5 @@ -66,7 +66,7 @@ org.junit junit-bom - 5.10.2 + 5.14.0 pom import @@ -74,7 +74,14 @@ com.github.umjammer vavi-commons - 1.1.12 + 1.1.16 + + + + org.mozilla + rhino + 1.8.1 + runtime