Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 085ea60d authored by Jérôme Euzenat's avatar Jérôme Euzenat
Browse files

- suppressed dependency from google translate + fixed dependency with reflection

parent b3136f08
No related branches found
No related tags found
No related merge requests found
File deleted
<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>
File deleted
<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>
......@@ -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 );
......
......@@ -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;
......
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