diff --git a/lib/google-translate/google-api-translate-java.jar b/lib/google-translate/google-api-translate-java.jar deleted file mode 100644 index 9902effd7deff2d60b4e7e6265dfe3ef90ff6648..0000000000000000000000000000000000000000 Binary files a/lib/google-translate/google-api-translate-java.jar and /dev/null differ diff --git a/lib/google-translate/google-api-translate-java.pom b/lib/google-translate/google-api-translate-java.pom deleted file mode 100644 index 99498c0bd0c8293a39bfcfb3311d114f9f806ea4..0000000000000000000000000000000000000000 --- a/lib/google-translate/google-api-translate-java.pom +++ /dev/null @@ -1,51 +0,0 @@ -<project> - <modelVersion>4.0.0</modelVersion> - <!-- JE: from original pom --> - <groupId>com.google.api</groupId> - <artifactId>google-api-translate-java</artifactId> - <version>0.93-SNAPSHOT</version> - <name>google-api-translate-java</name> - <description>A Java wrapper for the Google Translate service</description> - <licenses> - <license> - <name>GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007</name> - <url>http://www.gnu.org/licenses/lgpl-3.0.html</url> - </license> - </licenses> - - <!--url></url> - <distributionManagement> - <downloadUrl></downloadUrl> - </distributionManagement--> - - <!--dependencies> - <dependency> - <groupId>org.json</groupId> - <artifactId>json</artifactId> - <version>20090211</version> - </dependency> - </dependencies--> - <build> - <plugins> - <plugin> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <source>1.5</source> - <target>1.5</target> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jar-plugin</artifactId> - <configuration> - <archive> - <manifest> - <addClasspath>true</addClasspath> - <mainClass>com.google.api.translate.TranslatorFrame</mainClass> - </manifest> - </archive> - </configuration> - </plugin> - </plugins> - </build> -</project> diff --git a/lib/google-translate/json.jar b/lib/google-translate/json.jar deleted file mode 100644 index ef29094093d39ecf5a50c24fc61f10c8c5b6b195..0000000000000000000000000000000000000000 Binary files a/lib/google-translate/json.jar and /dev/null differ diff --git a/lib/google-translate/json.pom b/lib/google-translate/json.pom deleted file mode 100644 index af07b6908dc42444e7d6e36e34564adabb89eb95..0000000000000000000000000000000000000000 --- a/lib/google-translate/json.pom +++ /dev/null @@ -1,29 +0,0 @@ -<project> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.json</groupId> - <artifactId>json</artifactId> - <version>20090211</version> - <!--name></name> - <description></description--> - <licenses> - <license> - <name></name> - <url></url> - </license> - </licenses> - - <!--url></url> - <distributionManagement> - <downloadUrl></downloadUrl> - </distributionManagement> - - <dependencies> - <dependency> - <groupId></groupId> - <artifactId></artifactId> - <version></version> - </dependency> - </dependencies--> - -</project> diff --git a/src/fr/inrialpes/exmo/align/gen/alt/RenameThings.java b/src/fr/inrialpes/exmo/align/gen/alt/RenameThings.java index 9c95208e543267d91250256130847c1e7cfbcc61..bba01d02e0ca24b8388ec7a057a4ed73483e77f6 100755 --- a/src/fr/inrialpes/exmo/align/gen/alt/RenameThings.java +++ b/src/fr/inrialpes/exmo/align/gen/alt/RenameThings.java @@ -31,10 +31,15 @@ import com.hp.hpl.jena.ontology.OntProperty; import com.hp.hpl.jena.ontology.OntModelSpec; import com.hp.hpl.jena.ontology.OntClass; +//activeRandomString is true -> we replace the label with a random string +//activeTranslateString is true -> we translate the label + +/* //Google API classes import com.google.api.GoogleAPI; import com.google.api.translate.Language; import com.google.api.translate.Translate; +*/ /* //WordNet API classes @@ -42,11 +47,6 @@ import edu.smu.tspell.wordnet.Synset; import edu.smu.tspell.wordnet.WordNetDatabase; */ -// JE: reengineer this class... (what have we to rename) - -//activeRandomString is true -> we replace the label with a random string -//activeTranslateString is true -> we translate the label - import java.util.Properties; import java.util.List; import java.util.ArrayList; @@ -448,46 +448,47 @@ public abstract class RenameThings extends BasicAlterator { } //translates the string from English to French + // Google translate API is now a paid service public String translateString( String source ) { + /* String translatedText = ""; + // This should be the URL of your web site GoogleAPI.setHttpReferrer("http://code.google.com/p/google-api-translate-java/"); - //Translate.setHttpReferrer("http://code.google.com/p/google-api-translate-java/"); + // Key to paid service + GoogleAPI.setKey( **** Enter your API key here **** ); try { translatedText = Translate.execute(source, Language.ENGLISH, Language.FRENCH); } catch (Exception e) { logger.debug( "IGNORED Exception", e ); } return removeSpaces ( translatedText ); + */ + return source; } public String getSynonym( String source ) { - return source; - } /* - //synonym of the word - public String getSynonym ( String source ) { - String synonym = ""; - //set this variable according to your WordNet installation folder - //see : http://lyle.smu.edu/~tspell/jaws/index.html - System.setProperty("wordnet.database.dir", "/usr/Wordnet/WordNet-3.0/dict"); - WordNetDatabase database = WordNetDatabase.getFileInstance(); - Synset[] synsets = database.getSynsets( source ); - if (synsets.length > 0) { - for (int i = 0; i < synsets.length; i++) { - String[] wordForms = synsets[i].getWordForms(); - for (int j = 0; j < wordForms.length; j++) { - if ( !wordForms[j].equals( source ) ) { - synonym = removeSpaces ( wordForms[j] ); - return synonym; - } - } - } - } - else - return source; - return source; - } + String synonym = ""; + //set this variable according to your WordNet installation folder + //and please pass it as argument + //see : http://lyle.smu.edu/~tspell/jaws/index.html + System.setProperty("wordnet.database.dir", "/usr/Wordnet/WordNet-3.0/dict"); + WordNetDatabase database = WordNetDatabase.getFileInstance(); + Synset[] synsets = database.getSynsets( source ); + if (synsets.length > 0) { + for (int i = 0; i < synsets.length; i++) { + String[] wordForms = synsets[i].getWordForms(); + for (int j = 0; j < wordForms.length; j++) { + if ( !wordForms[j].equals( source ) ) { + synonym = removeSpaces ( wordForms[j] ); + return synonym; + } + } + } + } else return source; */ + return source; + } public String parseString (String str, boolean activeTranslateString, boolean activeSynonym) { // logger.trace( "str = [{}]", str ); diff --git a/src/fr/inrialpes/exmo/align/service/AServProtocolManager.java b/src/fr/inrialpes/exmo/align/service/AServProtocolManager.java index a3401f3b06d7550cb6d10951d9201236962f8748..f377babf3545f9080924779df4a39494669f79b7 100644 --- a/src/fr/inrialpes/exmo/align/service/AServProtocolManager.java +++ b/src/fr/inrialpes/exmo/align/service/AServProtocolManager.java @@ -61,8 +61,8 @@ import org.semanticweb.owl.align.AlignmentVisitor; import org.semanticweb.owl.align.AlignmentException; import org.semanticweb.owl.align.Evaluator; -import org.reflections.Reflections; -import org.reflections.util.ConfigurationBuilder; +//import org.reflections.Reflections; +//import org.reflections.util.ConfigurationBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory;