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
8d5d1daa
"README.md" did not exist on "1833b92e40d53fee57d4e83544ac60ccecc8a0ae"
Commit
8d5d1daa
authored
14 years ago
by
Jérôme Euzenat
Browse files
Options
Downloads
Patches
Plain Diff
- enabled Wu-Palmer and gloss-overlap (from Ontosim implementation)
parent
8295fc5c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/fr/inrialpes/exmo/align/ling/JWNLAlignment.java
+21
-7
21 additions, 7 deletions
src/fr/inrialpes/exmo/align/ling/JWNLAlignment.java
with
21 additions
and
7 deletions
src/fr/inrialpes/exmo/align/ling/JWNLAlignment.java
+
21
−
7
View file @
8d5d1daa
/*
* $Id$
*
* Copyright (C) INRIA, 2003-2005, 2007, 2009
* Copyright (C) INRIA, 2003-2005, 2007, 2009
-2010
*
* 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
...
...
@@ -40,11 +40,18 @@ import java.net.URI;
public
class
JWNLAlignment
extends
DistanceAlignment
implements
AlignmentProcess
{
final
static
String
WNVERS
=
"3.0"
;
final
static
int
BASICSYNDIST
=
0
;
final
static
int
COSYNSIM
=
1
;
final
static
int
BASICSYNSIM
=
2
;
final
static
int
WUPALMER
=
3
;
final
static
int
GLOSSOV
=
4
;
protected
class
WordNetMatrixMeasure
extends
MatrixMeasure
{
protected
JWNLDistances
Dist
=
null
;
protected
int
method
=
0
;
public
WordNetMatrixMeasure
()
{
similarity
=
false
;
Dist
=
new
JWNLDistances
();
}
public
void
init
()
throws
AlignmentException
{
...
...
@@ -65,12 +72,16 @@ public class JWNLAlignment extends DistanceAlignment implements AlignmentProcess
String
s2
=
ontology2
().
getEntityName
(
o2
);
if
(
s1
==
null
||
s2
==
null
)
return
1
.;
switch
(
method
)
{
case
0
:
case
BASICSYNDIST
:
return
Dist
.
basicSynonymDistance
(
s1
,
s2
);
case
1
:
case
COSYNSIM
:
return
1
.
-
Dist
.
cosynonymySimilarity
(
s1
,
s2
);
case
2
:
case
BASICSYNSIM
:
return
1
.
-
Dist
.
basicSynonymySimilarity
(
s1
,
s2
);
case
WUPALMER:
return
1
.
-
Dist
.
wuPalmerSimilarity
(
s1
,
s2
);
case
GLOSSOV:
return
1
.
-
Dist
.
basicGlossOverlap
(
s1
,
s2
);
default
:
return
Dist
.
basicSynonymDistance
(
s1
,
s2
);
}
...
...
@@ -95,19 +106,22 @@ public class JWNLAlignment extends DistanceAlignment implements AlignmentProcess
/** Processing **/
public
void
align
(
Alignment
alignment
,
Properties
prop
)
throws
AlignmentException
{
int
method
=
0
;
int
method
=
BASICSYNDIST
;
loadInit
(
alignment
);
WordNetMatrixMeasure
sim
=
(
WordNetMatrixMeasure
)
getSimilarity
();
String
wnvers
=
prop
.
getProperty
(
"wnvers"
);
if
(
wnvers
==
null
)
wnvers
=
WNVERS
;
String
function
=
prop
.
getProperty
(
"wnfunction"
);
if
(
function
!=
null
)
{
if
(
function
.
equals
(
"cosynonymySimilarity"
)
)
method
=
1
;
else
if
(
function
.
equals
(
"basicSynonymySimilarity"
)
)
method
=
2
;
if
(
function
.
equals
(
"cosynonymySimilarity"
)
)
method
=
COSYNSIM
;
else
if
(
function
.
equals
(
"basicSynonymySimilarity"
)
)
method
=
BASICSYNSIM
;
else
if
(
function
.
equals
(
"wuPalmerSimilarity"
)
)
method
=
WUPALMER
;
else
if
(
function
.
equals
(
"glossOverlapSimilarity"
)
)
method
=
GLOSSOV
;
}
sim
.
init
(
prop
.
getProperty
(
"wndict"
),
wnvers
,
method
);
sim
.
initialize
(
ontology1
(),
ontology2
(),
alignment
);
sim
.
compute
(
prop
);
prop
.
setProperty
(
"algName"
,
getClass
()+
"/"
+
function
);
if
(
prop
.
getProperty
(
"printMatrix"
)
!=
null
)
printDistanceMatrix
(
prop
);
extract
(
type
,
prop
);
}
...
...
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