← Back to team overview

kadosu-dev team mailing list archive

[Branch ~kadosu-dev/kadosu/main] Rev 120: o fix config

 

------------------------------------------------------------
revno: 120
committer: Martin Schaaf <mascha@xxxxxxxxxx>
branch nick: kadosu
timestamp: Sun 2009-11-22 20:59:06 +0100
message:
  o fix config
  o remove java 1.7 dep until it is release/common used
  o implement bundle activator
removed:
  org.kadosu.plugin.speech.german/Voxforge_German_20090508.jar
added:
  org.kadosu.plugin.speech.german/plugin.properties
modified:
  org.kadosu.plugin.speech.german/.classpath
  org.kadosu.plugin.speech.german/META-INF/MANIFEST.MF
  org.kadosu.plugin.speech.german/build.properties
  org.kadosu.plugin.speech.german/src/main/org/kadosu/document/plugin/speech/german/DocumentSpeechGerman.java
  org.kadosu.plugin.speech.german/src/main/org/kadosu/document/plugin/speech/german/DocumentSpeechGermanHandler.java
  org.kadosu.plugin.speech.german/src/main/org/kadosu/plugin/speech/german/SpeechPluginGerman.java
  org.kadosu.plugin.speech.german/src/resources/org/kadosu/plugin/speech/german/config_wogrammar.xml


--
lp:kadosu
https://code.launchpad.net/~kadosu-dev/kadosu/main

Your team Kadosu Developer is subscribed to branch lp:kadosu.
To unsubscribe from this branch go to https://code.launchpad.net/~kadosu-dev/kadosu/main/+edit-subscription.
=== modified file 'org.kadosu.plugin.speech.german/.classpath'
--- org.kadosu.plugin.speech.german/.classpath	2009-11-16 20:40:08 +0000
+++ org.kadosu.plugin.speech.german/.classpath	2009-11-22 19:59:06 +0000
@@ -5,6 +5,5 @@
 	<classpathentry kind="src" path="src/main"/>
 	<classpathentry kind="src" path="src/resources"/>
 	<classpathentry kind="src" path="src/test"/>
-	<classpathentry exported="true" kind="lib" path="Voxforge_German_20090508.jar" sourcepath="org.kadosu.plugin.speech.germansrc.zip"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>

=== modified file 'org.kadosu.plugin.speech.german/META-INF/MANIFEST.MF'
--- org.kadosu.plugin.speech.german/META-INF/MANIFEST.MF	2009-11-09 19:09:56 +0000
+++ org.kadosu.plugin.speech.german/META-INF/MANIFEST.MF	2009-11-22 19:59:06 +0000
@@ -1,13 +1,17 @@
 Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
-Bundle-Name: Voxforge German Kadosu Speech Plug-in
-Bundle-SymbolicName: org.kadosu.plugin.speech.german;singleton:=true
-Bundle-Version: 1.0.0
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.kadosu.document.plugin.speech.german;singleton:=true
+Bundle-Version: 1.0.0.qualifier
 Bundle-Activator: org.kadosu.plugin.speech.german.SpeechPluginGerman
 Bundle-ActivationPolicy: lazy
 Import-Package: org.osgi.framework;version="1.3.0"
 Require-Bundle: org.kadosu;bundle-version="0.2.0",
  org.kadosu.plugin.speech;bundle-version="1.0.0",
- org.junit4
-Bundle-ClassPath: Voxforge_German_20090508.jar
+ org.junit4,
+ org.eclipse.ui;bundle-version="3.4.2",
+ org.eclipse.core.runtime;bundle-version="3.4.0"
+Bundle-ClassPath: germanSpeech.jar
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-Localization: plugin
+Export-Package: org.kadosu.document.plugin.speech.german

=== removed file 'org.kadosu.plugin.speech.german/Voxforge_German_20090508.jar'
Binary files org.kadosu.plugin.speech.german/Voxforge_German_20090508.jar	2009-11-09 19:09:56 +0000 and org.kadosu.plugin.speech.german/Voxforge_German_20090508.jar	1970-01-01 00:00:00 +0000 differ
=== modified file 'org.kadosu.plugin.speech.german/build.properties'
--- org.kadosu.plugin.speech.german/build.properties	2009-11-09 19:09:56 +0000
+++ org.kadosu.plugin.speech.german/build.properties	2009-11-22 19:59:06 +0000
@@ -1,14 +1,16 @@
 output.. = bin/
 bin.includes = META-INF/,\
                plugin.xml,\
-               Voxforge_German_20090508.jar,\
-               src/resources/org/kadosu/plugin/speech/german/config.xml
+               germanSpeech.jar,\
+               plugin.properties
 src.includes = .classpath,\
                .project,\
                .settings/,\
                META-INF/,\
-               Voxforge_German_20090508.jar,\
                build.properties,\
-               src/resources/org/kadosu/plugin/speech/german/config.xml,\
                plugin.xml,\
                src/
+source.germanSpeech.jar = src/main/,\
+                          src/resources/,\
+                          src/test/
+jars.compile.order = germanSpeech.jar

=== added file 'org.kadosu.plugin.speech.german/plugin.properties'
--- org.kadosu.plugin.speech.german/plugin.properties	1970-01-01 00:00:00 +0000
+++ org.kadosu.plugin.speech.german/plugin.properties	2009-11-22 19:59:06 +0000
@@ -0,0 +1,2 @@
+#Properties file for org.kadosu.plugin.speech.german
+Bundle-Name.0 = Voxforge German Kadosu Speech Plug-in
\ No newline at end of file

=== modified file 'org.kadosu.plugin.speech.german/src/main/org/kadosu/document/plugin/speech/german/DocumentSpeechGerman.java'
--- org.kadosu.plugin.speech.german/src/main/org/kadosu/document/plugin/speech/german/DocumentSpeechGerman.java	2009-11-09 19:09:56 +0000
+++ org.kadosu.plugin.speech.german/src/main/org/kadosu/document/plugin/speech/german/DocumentSpeechGerman.java	2009-11-22 19:59:06 +0000
@@ -6,8 +6,9 @@
 
 public class DocumentSpeechGerman extends DocumentSpeech {
 
-    public DocumentSpeechGerman() {
-        URL resource = DocumentSpeechGerman.class.getResource("/org/kadosu/plugin/speech/german/config_wogrammar.xml");
-        setConfigFile(resource.getFile());
-    }
+  public DocumentSpeechGerman() {
+    URL resource = DocumentSpeechGerman.class.getResource( "/org/kadosu/plugin/speech/german/config_wogrammar.xml");
+
+    setConfigFile( resource);
+  }
 }

=== modified file 'org.kadosu.plugin.speech.german/src/main/org/kadosu/document/plugin/speech/german/DocumentSpeechGermanHandler.java'
--- org.kadosu.plugin.speech.german/src/main/org/kadosu/document/plugin/speech/german/DocumentSpeechGermanHandler.java	2009-11-09 19:09:56 +0000
+++ org.kadosu.plugin.speech.german/src/main/org/kadosu/document/plugin/speech/german/DocumentSpeechGermanHandler.java	2009-11-22 19:59:06 +0000
@@ -5,7 +5,6 @@
 import org.kadosu.document.plugin.speech.DocumentSpeechHandler;
 import org.kadosu.exception.KDSAccessException;
 import org.kadosu.misc.Logger;
-import org.kadosu.misc.Utils;
 import org.kadosu.plugin.speech.german.SpeechPluginGerman;
 
 public class DocumentSpeechGermanHandler extends DocumentSpeechHandler {
@@ -18,23 +17,24 @@
         try {
             File file = new File(path);
             if (super.isDocument(path)) {
-                if (Utils.JAVA_VERSION[0].equals("1") && Utils.JAVA_VERSION[1].equals("7")) {
-                    // try {
-                    // java.nio.file.attribute.UserDefinedFileAttributeView
-                    // fileAttributeView = file.toPath()
-                    // .getFileAttributeView(java.nio.file.attribute.UserDefinedFileAttributeView.class);
-                    // String language = new String((byte[])
-                    // fileAttributeView.getAttribute("language"));
-                    // if ("de".equals(language)) {
-                    // result = true;
-                    // }
-                    // } catch (IOException e) {
-                    // throw new KDSAccessException(e.getMessage());
-                } else {
-                    if (file.getName().contains("_de")) {
-                        result = true;
-                    }
+                // if (Utils.JAVA_VERSION[0].equals("1") &&
+                // Utils.JAVA_VERSION[1].equals("7")) {
+                // try {
+                // java.nio.file.attribute.UserDefinedFileAttributeView
+                // fileAttributeView = file.toPath()
+                // .getFileAttributeView(java.nio.file.attribute.UserDefinedFileAttributeView.class);
+                // String language = new String((byte[])
+                // fileAttributeView.getAttribute("language"));
+                // if ("de".equals(language)) {
+                // result = true;
+                // }
+                // } catch (IOException e) {
+                // throw new KDSAccessException(e.getMessage());
+                // } else {
+                if (file.getName().contains("_de")) {
+                    result = true;
                 }
+                // }
             }
         } catch (Exception e) {
             LOG.error("File not supported '" + path + "'", e);

=== modified file 'org.kadosu.plugin.speech.german/src/main/org/kadosu/plugin/speech/german/SpeechPluginGerman.java'
--- org.kadosu.plugin.speech.german/src/main/org/kadosu/plugin/speech/german/SpeechPluginGerman.java	2009-11-09 19:09:56 +0000
+++ org.kadosu.plugin.speech.german/src/main/org/kadosu/plugin/speech/german/SpeechPluginGerman.java	2009-11-22 19:59:06 +0000
@@ -1,29 +1,80 @@
 package org.kadosu.plugin.speech.german;
 
-import org.osgi.framework.BundleActivator;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
 import org.osgi.framework.BundleContext;
 
-public class SpeechPluginGerman implements BundleActivator {
-
-    public static final String ID = SpeechPluginGerman.class.getCanonicalName();;
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext
-     * )
-     */
-    public void start(BundleContext context) throws Exception {
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
-     */
-    public void stop(BundleContext context) throws Exception {
-    }
-
+public class SpeechPluginGerman extends AbstractUIPlugin {
+
+  public static final String ID = SpeechPluginGerman.class.getCanonicalName();;
+
+  private static SpeechPluginGerman plugin;
+
+  // Resource bundle.
+  private ResourceBundle resourceBundle;
+
+  public SpeechPluginGerman() {
+    super();
+    plugin = this;
+    try {
+      resourceBundle = ResourceBundle.getBundle( "org.kadosu.ui.plugin.SpeechPluginGermanResources");
+    } catch (MissingResourceException x) {
+      resourceBundle = null;
+    }
+  }
+
+  /**
+   * Returns the shared instance.
+   * 
+   * @return The shared PdfboxPlugin instance.
+   */
+  public static SpeechPluginGerman getDefault() {
+    return plugin;
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext )
+   */
+  @Override
+  public void start( BundleContext context) throws Exception {
+    super.start( context);
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+   */
+  @Override
+  public void stop( BundleContext context) throws Exception {
+    super.stop( context);
+  }
+
+  /**
+   * Returns the string from the plugin's resource bundle, or 'key' if not found.
+   * 
+   * @param key
+   * @return The resource string.
+   */
+  public static String getResourceString( String key) {
+    ResourceBundle bundle = SpeechPluginGerman.getDefault().getResourceBundle();
+    try {
+      return (bundle != null) ? bundle.getString( key) : key;
+    } catch (MissingResourceException e) {
+      return key;
+    }
+  }
+
+  /**
+   * Returns the plugin's resource bundle,
+   * 
+   * @return The ResourceBundle object.
+   */
+  public ResourceBundle getResourceBundle() {
+    return this.resourceBundle;
+  }
 }

=== modified file 'org.kadosu.plugin.speech.german/src/resources/org/kadosu/plugin/speech/german/config_wogrammar.xml'
--- org.kadosu.plugin.speech.german/src/resources/org/kadosu/plugin/speech/german/config_wogrammar.xml	2009-11-09 19:09:56 +0000
+++ org.kadosu.plugin.speech.german/src/resources/org/kadosu/plugin/speech/german/config_wogrammar.xml	2009-11-22 19:59:06 +0000
@@ -158,7 +158,7 @@
         <property name="maxDepth" value="3"/>
         <property name="logMath" value="logMath"/>
         <property name="dictionary" value="dictionary"/>
-        <property name="location" value="resource:/org.kadosu.document.plugin.speech.german.DocumentSpeechGerman!/org/kadosu/plugin/speech/german/voxforge_de_sphinx.lm"/>
+        <property name="location" value="resource:/edu.cmu.sphinx.model.acoustic.Voxforge_German.Model!/edu/cmu/sphinx/model/acoustic/Voxforge_German/etc/voxforge_de_sphinx.lm"/>
     </component>