Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Alignment API
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
moex
Alignment API
Commits
66b95962
Commit
66b95962
authored
12 years ago
by
Jérôme Euzenat
Browse files
Options
Downloads
Patches
Plain Diff
- added JWNL tests / fixed JSON test
parent
e6bec437
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
test/src/EDOALExportTest.java
+1
-1
1 addition, 1 deletion
test/src/EDOALExportTest.java
test/src/JWNLTest.java
+94
-9
94 additions, 9 deletions
test/src/JWNLTest.java
test/src/READMETest.java
+5
-5
5 additions, 5 deletions
test/src/READMETest.java
with
100 additions
and
15 deletions
test/src/EDOALExportTest.java
+
1
−
1
View file @
66b95962
...
...
@@ -175,7 +175,7 @@ public class EDOALExportTest {
writer
.
close
();
String
str1
=
stream
.
toString
();
//System.err.println(str1);
assertEquals
(
str1
.
length
(),
3609
5
);
assertEquals
(
str1
.
length
(),
3609
7
);
}
@Test
(
groups
=
{
"full"
,
"omwg"
,
"raw"
},
dependsOnMethods
=
{
"setUp"
})
...
...
This diff is collapsed.
Click to expand it.
test/src/JWNLTest.java
+
94
−
9
View file @
66b95962
/*
* $Id$
*
* Copyright (C) INRIA, 2008-2010
* Copyright (C) INRIA, 2008-2010
, 2013
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
...
...
@@ -62,21 +62,19 @@ public class JWNLTest {
}
@Test
(
groups
=
{
"full"
,
"ling"
})
public
void
routineJWNLAlignmentTest
()
throws
Exception
{
public
void
routine
Default
JWNLAlignmentTest
()
throws
Exception
{
/*
$ setenv WNDIR ../WordNet-
2
.0/dict
$ setenv WNDIR ../WordNet-
3
.0/dict
$ java -jar lib/procalign.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
*/
Properties
params
=
new
Properties
();
//System.getenv("WNDIR");
//params.setProperty( "wndict", "../WordNet-2.0/dict" );
params
.
setProperty
(
"wndict"
,
"../WordNet-3.0/dict"
);
alignment
=
new
JWNLAlignment
();
assertNotNull
(
alignment
,
"ObjectAlignment should not be null"
);
assertEquals
(
alignment
.
nbCells
(),
0
);
alignment
.
init
(
new
URI
(
"file:examples/rdf/edu.umbc.ebiquity.publication.owl"
),
new
URI
(
"file:examples/rdf/edu.mit.visus.bibtex.owl"
));
alignment
.
align
(
(
Alignment
)
null
,
params
);
assertEquals
(
alignment
.
nbCells
(),
43
);
assertEquals
(
alignment
.
nbCells
(),
13
43
);
ByteArrayOutputStream
stream
=
new
ByteArrayOutputStream
();
PrintWriter
writer
=
new
PrintWriter
(
new
BufferedWriter
(
...
...
@@ -85,19 +83,106 @@ $ java -jar lib/procalign.jar -Dwndict=$WNDIR file://$CWD/examples/rdf/edu.umbc.
alignment
.
render
(
renderer
);
writer
.
flush
();
writer
.
close
();
assertEquals
(
stream
.
toString
().
length
(),
14027
,
"Rendered differently"
);
assertEquals
(
stream
.
toString
().
length
(),
411462
,
"Rendered differently"
);
alignment
.
cut
(
"hard"
,
0.4
);
assertEquals
(
alignment
.
nbCells
(),
38
);
assertEquals
(
alignment
.
nbCells
(),
122
);
// Different similarity
}
@Test
(
groups
=
{
"full"
,
"ling"
})
public
void
routineCoSynonymyJWNLAlignmentTest
()
throws
Exception
{
Properties
params
=
new
Properties
();
params
.
setProperty
(
"wndict"
,
"../WordNet-3.0/dict"
);
params
.
setProperty
(
"wnfunction"
,
"cosynonymySimilarity"
);
alignment
=
new
JWNLAlignment
();
assertNotNull
(
alignment
,
"ObjectAlignment should not be null"
);
assertEquals
(
alignment
.
nbCells
(),
0
);
alignment
.
init
(
new
URI
(
"file:examples/rdf/edu.umbc.ebiquity.publication.owl"
),
new
URI
(
"file:examples/rdf/edu.mit.visus.bibtex.owl"
));
alignment
.
align
(
(
Alignment
)
null
,
params
);
assertEquals
(
alignment
.
nbCells
(),
3
);
ByteArrayOutputStream
stream
=
new
ByteArrayOutputStream
();
PrintWriter
writer
=
new
PrintWriter
(
new
BufferedWriter
(
new
OutputStreamWriter
(
stream
,
"UTF-8"
)),
true
);
AlignmentVisitor
renderer
=
new
RDFRendererVisitor
(
writer
);
alignment
.
render
(
renderer
);
writer
.
flush
();
writer
.
close
();
assertEquals
(
stream
.
toString
().
length
(),
1985
,
"Rendered differently"
);
alignment
.
cut
(
"hard"
,
0.4
);
assertEquals
(
alignment
.
nbCells
(),
3
);
}
@Test
(
groups
=
{
"full"
,
"ling"
})
public
void
routineBasicSynonymyJWNLAlignmentTest
()
throws
Exception
{
Properties
params
=
new
Properties
();
params
.
setProperty
(
"wndict"
,
"../WordNet-3.0/dict"
);
params
.
setProperty
(
"wnfunction"
,
"basicSynonymySimilarity"
);
alignment
=
new
JWNLAlignment
();
assertNotNull
(
alignment
,
"ObjectAlignment should not be null"
);
assertEquals
(
alignment
.
nbCells
(),
0
);
alignment
.
init
(
new
URI
(
"file:examples/rdf/edu.umbc.ebiquity.publication.owl"
),
new
URI
(
"file:examples/rdf/edu.mit.visus.bibtex.owl"
));
alignment
.
align
(
(
Alignment
)
null
,
params
);
assertEquals
(
alignment
.
nbCells
(),
10
);
ByteArrayOutputStream
stream
=
new
ByteArrayOutputStream
();
PrintWriter
writer
=
new
PrintWriter
(
new
BufferedWriter
(
new
OutputStreamWriter
(
stream
,
"UTF-8"
)),
true
);
AlignmentVisitor
renderer
=
new
RDFRendererVisitor
(
writer
);
alignment
.
render
(
renderer
);
writer
.
flush
();
writer
.
close
();
assertEquals
(
stream
.
toString
().
length
(),
4037
,
"Rendered differently"
);
alignment
.
cut
(
"hard"
,
0.4
);
assertEquals
(
alignment
.
nbCells
(),
10
);
}
@Test
(
groups
=
{
"full"
,
"ling"
})
public
void
routineWuPalmerJWNLAlignmentTest
()
throws
Exception
{
Properties
params
=
new
Properties
();
params
.
setProperty
(
"wndict"
,
"../WordNet-3.0/dict"
);
params
.
setProperty
(
"wnfunction"
,
"wuPalmerSimilarity"
);
alignment
=
new
JWNLAlignment
();
assertNotNull
(
alignment
,
"ObjectAlignment should not be null"
);
assertEquals
(
alignment
.
nbCells
(),
0
);
alignment
.
init
(
new
URI
(
"file:examples/rdf/edu.umbc.ebiquity.publication.owl"
),
new
URI
(
"file:examples/rdf/edu.mit.visus.bibtex.owl"
));
alignment
.
align
(
(
Alignment
)
null
,
params
);
assertEquals
(
alignment
.
nbCells
(),
40
);
ByteArrayOutputStream
stream
=
new
ByteArrayOutputStream
();
PrintWriter
writer
=
new
PrintWriter
(
new
BufferedWriter
(
new
OutputStreamWriter
(
stream
,
"UTF-8"
)),
true
);
AlignmentVisitor
renderer
=
new
RDFRendererVisitor
(
writer
);
alignment
.
render
(
renderer
);
writer
.
flush
();
writer
.
close
();
assertEquals
(
stream
.
toString
().
length
(),
13081
,
"Rendered differently"
);
alignment
.
cut
(
"hard"
,
0.4
);
assertEquals
(
alignment
.
nbCells
(),
35
);
}
@Test
(
groups
=
{
"full"
,
"ling"
})
public
void
routineGlossOverlapJWNLAlignmentTest
()
throws
Exception
{
Properties
params
=
new
Properties
();
params
.
setProperty
(
"wndict"
,
"../WordNet-3.0/dict"
);
params
.
setProperty
(
"wnfunction"
,
"glossOverlapSimilarity"
);
alignment
=
new
JWNLAlignment
();
assertNotNull
(
alignment
,
"ObjectAlignment should not be null"
);
assertEquals
(
alignment
.
nbCells
(),
0
);
alignment
.
init
(
new
URI
(
"file:examples/rdf/edu.umbc.ebiquity.publication.owl"
),
new
URI
(
"file:examples/rdf/edu.mit.visus.bibtex.owl"
));
alignment
.
align
(
(
Alignment
)
null
,
params
);
assertEquals
(
alignment
.
nbCells
(),
32
);
ByteArrayOutputStream
stream
=
new
ByteArrayOutputStream
();
PrintWriter
writer
=
new
PrintWriter
(
new
BufferedWriter
(
new
OutputStreamWriter
(
stream
,
"UTF-8"
)),
true
);
AlignmentVisitor
renderer
=
new
RDFRendererVisitor
(
writer
);
alignment
.
render
(
renderer
);
writer
.
flush
();
writer
.
close
();
assertEquals
(
stream
.
toString
().
length
(),
10757
,
"Rendered differently"
);
alignment
.
cut
(
"hard"
,
0.4
);
assertEquals
(
alignment
.
nbCells
(),
10
);
}
}
This diff is collapsed.
Click to expand it.
test/src/READMETest.java
+
5
−
5
View file @
66b95962
...
...
@@ -329,12 +329,12 @@ $ java -cp lib/procalign.jar fr.inrialpes.exmo.align.cli.EvalAlign -i fr.inrialp
writer
.
flush
();
writer
.
close
();
// These figures must be checked at least onece!
assertEquals
(
eval
.
getPrecision
(),
0.3181818181818182
);
assertEquals
(
eval
.
getRecall
(),
0.3939393939393939
);
assertEquals
(
eval
.
getNoise
(),
1.0
);
assertEquals
(
eval
.
getPrecision
(),
0.7619047619047619
);
//
0.3181818181818182
assertEquals
(
eval
.
getRecall
(),
1.0
);
//
0.3939393939393939
assertEquals
(
eval
.
getNoise
(),
0.23809523809523814
);
//
1.0
//assertEquals( eval.getFallout(), 1.0 );
assertEquals
(
eval
.
getFmeasure
(),
0.3520309477756286
);
assertEquals
(
eval
.
getOverall
(),
-
0.4502164502164502
);
assertEquals
(
eval
.
getFmeasure
(),
0.8648648648648648
);
//
0.3520309477756286
assertEquals
(
eval
.
getOverall
(),
0.6875
);
//
-0.4502164502164502
//assertEquals( eval.getResult(), 1.34375 );
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment