diff --git a/README.TXT b/README.TXT index 6e3633b476ebea470b50ef62ca514d04bbccf726..8d73931a3adb995d874560d6202ee0ede8b3178d 100644 --- a/README.TXT +++ b/README.TXT @@ -1,6 +1,6 @@ ####################################################################### # Ontology alignment API and implementation # -# 25/02/2007, version 3.0+ # +# 27/02/2007, version 3.0+ # ####################################################################### Copyright (C) 2003 The University of Manchester. @@ -74,11 +74,13 @@ $ java -jar lib/Procalign.jar file://$CWD/examples/rdf/edu.umbc.ebiquity.publica Using with JWNL (Wordnet) ------------------------- -- Wordnet 2.0 should be installed +- Wordnet 2.0 should be installed its directory to be put in $WNDIR - jwnl.jar commons-logging.jar must be in lib. -- file_properties.xml must be in current directory +(file_properties.xml need not anymore to be in current directory) -$ java -jar lib/alignwn.jar file://$CWD/examples/rdf/edu.umbc.ebiquity.publication.owl file://$CWD/examples/rdf/edu.mit.visus.bibtex.owl -i fr.inrialpes.exmo.align.ling.JWNLAlignment -o examples/rdf/JWNL.rdf +$ setenv WNDIR ../WordNet-2.0/dict + +$ java -jar lib/alignwn.jar -Dwndict=$WNDIR file://$CWD/examples/rdf/edu.umbc.ebiquity.publication.owl file://$CWD/examples/rdf/edu.mit.visus.bibtex.owl -i fr.inrialpes.exmo.align.ling.JWNLAlignment -o examples/rdf/JWNL.rdf LAST RELEASE ------------ diff --git a/file_properties.xml b/file_properties.xml deleted file mode 100644 index cf533e3ec210dd634a8bb1c973599e11fa6495e7..0000000000000000000000000000000000000000 --- a/file_properties.xml +++ /dev/null @@ -1,45 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<jwnl_properties language="en"> - <version publisher="Princeton" number="2.0" language="en"/> - <dictionary class="net.didion.jwnl.dictionary.FileBackedDictionary"> - <param name="morphological_processor" value="net.didion.jwnl.dictionary.morph.DefaultMorphologicalProcessor"> - <param name="operations"> - <param value="net.didion.jwnl.dictionary.morph.LookupExceptionsOperation"/> - <param value="net.didion.jwnl.dictionary.morph.DetachSuffixesOperation"> - <param name="noun" value="|s=|ses=s|xes=x|zes=z|ches=ch|shes=sh|men=man|ies=y|"/> - <param name="verb" value="|s=|ies=y|es=e|es=|ed=e|ed=|ing=e|ing=|"/> - <param name="adjective" value="|er=|est=|er=e|est=e|"/> - <param name="operations"> - <param value="net.didion.jwnl.dictionary.morph.LookupIndexWordOperation"/> - <param value="net.didion.jwnl.dictionary.morph.LookupExceptionsOperation"/> - </param> - </param> - <param value="net.didion.jwnl.dictionary.morph.TokenizerOperation"> - <param name="delimiters"> - <param value=" "/> - <param value="-"/> - </param> - <param name="token_operations"> - <param value="net.didion.jwnl.dictionary.morph.LookupIndexWordOperation"/> - <param value="net.didion.jwnl.dictionary.morph.LookupExceptionsOperation"/> - <param value="net.didion.jwnl.dictionary.morph.DetachSuffixesOperation"> - <param name="noun" value="|s=|ses=s|xes=x|zes=z|ches=ch|shes=sh|men=man|ies=y|"/> - <param name="verb" value="|s=|ies=y|es=e|es=|ed=e|ed=|ing=e|ing=|"/> - <param name="adjective" value="|er=|est=|er=e|est=e|"/> - <param name="operations"> - <param value="net.didion.jwnl.dictionary.morph.LookupIndexWordOperation"/> - <param value="net.didion.jwnl.dictionary.morph.LookupExceptionsOperation"/> - </param> - </param> - </param> - </param> - </param> - </param> - <param name="dictionary_element_factory" value="net.didion.jwnl.princeton.data.PrincetonWN17FileDictionaryElementFactory"/> - <param name="file_manager" value="net.didion.jwnl.dictionary.file_manager.FileManagerImpl"> - <param name="file_type" value="net.didion.jwnl.princeton.file.PrincetonRandomAccessDictionaryFile"/> - <param name="dictionary_path" value="../WordNet-2.0/dict"/> - </param> - </dictionary> - <resource class="PrincetonResource"/> -</jwnl_properties> diff --git a/html/relnotes.html b/html/relnotes.html index 4f4f2b90a88bd9ae585aea6ded31a85f31da24aa..ea7c47cbe74ec69b1e06c5a2a421a6ffe7db95a4 100644 --- a/html/relnotes.html +++ b/html/relnotes.html @@ -20,12 +20,12 @@ <li>Add full support for algebraic operations (meet/join/inv/compose)</li> <li>Implement better similarity/extractor</li> <li>Fully implement individual alignments</li> -<li>Getting rid of property files</li> <li>-d directory</li> <li>Include additional tags;</li> <li>Integrating tagging to the wordnet part</li> <li>Improve the metadata</li> <li>Build on unit tests</li> +<li>Test necessity and version of all shipped libraries</li> </ul></p> <h2>Under development</h2> @@ -33,11 +33,20 @@ <p><ul compact="1"> <li>Adding Web Service Alignment server profile</li> <li>Implement level 2OML alignments (version 3);</li> +<li>Improving web pages</li> <li>Completing the reference manual</li> </ul></p> <h2>Current SVN trunk version</h2> +<!--p><b>Version 3.1: xx/xx/2007 - ??</b></p--> + +<p><ul compact="1"> +<li>Got rid of the property file for wordnet</li> +<li>In Server/FIPA, suppressed generated files on close()</li> +<li>In Server/FIPA, suppressed printout</li> +</ul></p> + <h2>February 25th, 2007</h2> <p><b>Version 3.0: 25/02/2007 - Hyderabad</b></p> @@ -132,7 +141,7 @@ The main modification in this version is more independence from the <p><b>Version 2.2: 05/06/2006 - Onyeari's version a.k.a. may GForge be with you</b></p> -<p>Upgraded to OWL-API 06-04-12<br /> +<p>Upgraded to OWL-API 06-04-12 (1.4.3)<br /> <font color="red"></font> No problem encountered. </p> diff --git a/src/fr/inrialpes/exmo/align/ling/JWNLAlignment.java b/src/fr/inrialpes/exmo/align/ling/JWNLAlignment.java index e523b35c6ea5fa93338d6542c57c575ed3f29cf2..fb02f9a34a4550eea605844a57b162e046d93296 100644 --- a/src/fr/inrialpes/exmo/align/ling/JWNLAlignment.java +++ b/src/fr/inrialpes/exmo/align/ling/JWNLAlignment.java @@ -53,6 +53,9 @@ public class JWNLAlignment extends DistanceAlignment implements AlignmentProcess public void init() throws AlignmentException { Dist.Initialize(); } + public void init( String wndict ) throws AlignmentException { + Dist.Initialize( wndict ); + } public double measure( OWLClass cl1, OWLClass cl2 ) throws OWLException{ String s1 = cl1.getURI().getFragment(); String s2 = cl2.getURI().getFragment(); @@ -93,7 +96,7 @@ public class JWNLAlignment extends DistanceAlignment implements AlignmentProcess public void align( Alignment alignment, Parameters params ) throws AlignmentException { loadInit( alignment ); SynonymMatrixMeasure sim = (SynonymMatrixMeasure)getSimilarity(); - sim.init(); + sim.init( (String)params.getParameter("wndict") ); sim.initialize( (OWLOntology)getOntology1(), (OWLOntology)getOntology2(), alignment ); getSimilarity().compute( params ); if ( params.getParameter("printMatrix") != null ) printDistanceMatrix(params); diff --git a/src/fr/inrialpes/exmo/align/ling/JWNLDistances.java b/src/fr/inrialpes/exmo/align/ling/JWNLDistances.java index 674bad430c8a8b6e04556e876af757c4b730e551..66edafc11f88a5970237d99a39d7b1aef7f5e29a 100644 --- a/src/fr/inrialpes/exmo/align/ling/JWNLDistances.java +++ b/src/fr/inrialpes/exmo/align/ling/JWNLDistances.java @@ -24,8 +24,10 @@ package fr.inrialpes.exmo.align.ling; import fr.inrialpes.exmo.align.impl.method.StringDistances; import org.semanticweb.owl.align.AlignmentException; +import java.io.InputStream; import java.io.FileInputStream; import java.io.FileNotFoundException; +import java.io.ByteArrayInputStream; import java.util.Enumeration; import java.util.Hashtable; import java.util.Iterator; @@ -86,12 +88,37 @@ public class JWNLDistances { * directory */ public void Initialize() throws AlignmentException { - try { JWNL.initialize(new FileInputStream("./file_properties.xml")); - } catch ( JWNLException e ) { + Initialize( (String)null ); + } + + public void Initialize( String wordnetdir ) throws AlignmentException { + InputStream pptySource = null; + if ( wordnetdir == null ) { + try { + pptySource = new FileInputStream( "./file_properties.xml" ); + } catch ( FileNotFoundException e ) { + throw new AlignmentException( "Cannot find WordNet dictionary: use -Dwndict or file_property.xml" ); + } + } else { + String properties = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; + properties += "<jwnl_properties language=\"en\">"; + properties += " <resource class=\"PrincetonResource\"/>"; + properties += " <version publisher=\"Princeton\" number=\"2.0\" language=\"en\"/>"; + properties += " <dictionary class=\"net.didion.jwnl.dictionary.FileBackedDictionary\">"; + properties += " <param name=\"dictionary_element_factory\" value=\"net.didion.jwnl.princeton.data.PrincetonWN17FileDictionaryElementFactory\"/>"; + properties += " <param name=\"file_manager\" value=\"net.didion.jwnl.dictionary.file_manager.FileManagerImpl\">"; + properties += " <param name=\"file_type\" value=\"net.didion.jwnl.princeton.file.PrincetonRandomAccessDictionaryFile\"/>"; + properties += " <param name=\"dictionary_path\" value=\""+wordnetdir+"\"/>"; + properties += " </param>"; + properties += " </dictionary>"; + properties += "</jwnl_properties>"; + // Sorry but this initialize wants to read a stream + pptySource = new ByteArrayInputStream( properties.getBytes() ); + } + try { JWNL.initialize( pptySource ); } + catch ( JWNLException e ) { throw new AlignmentException( "Cannot initialize JWNL (WordNet)", e ); - } catch ( FileNotFoundException e ) { - throw new AlignmentException( "Cannot find WordNet property file (./file_properties.xml)", e ); - } + } } /**