public class Rank
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
Rank.WordAndRank
data structure.
|
Constructor and Description |
---|
Rank() |
Modifier and Type | Method and Description |
---|---|
java.util.ArrayList<Rank.WordAndRank> |
highestRankingCol(DISCOLuceneIndex disco,
java.util.Set<java.lang.String> words)
Finds the words in the index in whose collocation lists the
words rank highest. |
java.util.ArrayList<Rank.WordAndRank> |
highestRankingSim(DISCO disco,
java.util.Set<java.lang.String> words)
Finds the words in the index in whose similarity or collocation lists the
words rank highest. |
int |
rankCol(DISCOLuceneIndex disco,
java.lang.String w1,
java.lang.String w2)
Computes the rank of w2 among the collocations of w1.
|
int |
rankSim(DISCO disco,
java.lang.String w1,
java.lang.String w2)
Computes the rank of w2 in the similarity list of w1.
|
public int rankSim(DISCO disco, java.lang.String w1, java.lang.String w2) throws java.io.IOException, WrongWordspaceTypeException
DISCO.WordspaceType.COL
(use
de.linguatools.disco.Rank.rankCol
instead).disco
- w1
- input word #1 (must be a single token).w2
- input word #2 (must be a single token).java.io.IOException
WrongWordspaceTypeException
- if the disco
word space
is not of type DISCO.WordspaceType.SIM
.public int rankCol(DISCOLuceneIndex disco, java.lang.String w1, java.lang.String w2) throws java.io.IOException
DISCOLuceneIndex
but not with DenseMatrix
!disco
- w1
- input word #1 (must be a single token).w2
- input word #2 (must be a single token).java.io.IOException
public java.util.ArrayList<Rank.WordAndRank> highestRankingSim(DISCO disco, java.util.Set<java.lang.String> words) throws java.io.IOException, WrongWordspaceTypeException
words
rank highest. There must be at least one word in
words
.v
from the word space vocabulary, the method
looks up on which rank the input words occur among the similar words of
v
. The score of v
is the product of these
ranks. The lower the rank product, the more similar v
is to
words
.DISCO.WordspaceType.COL
(use
de.linguatools.disco.Rank.highestRankingCol
instead).disco
- DISCO word space (in-memory)words
- set of input words (all words must be single tokens).words
was found in the index,
the return value is null.java.io.IOException
WrongWordspaceTypeException
public java.util.ArrayList<Rank.WordAndRank> highestRankingCol(DISCOLuceneIndex disco, java.util.Set<java.lang.String> words) throws java.io.IOException, WrongWordspaceTypeException
words
rank highest. There must be at least one word in
words
.v
from the word space vocabulary, the method
looks up on which rank the input words occur among the collocations of
v
. The score of v
is the product of these
ranks. The lower the rank product, the more similar v
is to
words
.DISCOLuceneIndex
but not with DenseMatrix
.disco
- DISCO word space (in-memory)words
- set of input words (all words must be single tokens).words
was found in the index,
the return value is null.java.io.IOException
WrongWordspaceTypeException