|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.terrier.utility.Distance
public class Distance
Class containing useful utility methods for counting the number of occurrences of two terms within windows, etc.
Constructor Summary | |
---|---|
Distance()
|
Method Summary | |
---|---|
protected static int |
countTrue(boolean[] in)
|
static int |
findSmallest(int[] x,
int[] y)
Find smallest difference between two elements of two arrays |
static int |
noTimes(int[][] blocksForEachTerm,
int windowSize,
int documentLengthInTokens)
Counts number of blocks where all given terms occur within a block of windowSize in length, in a document of length documentLengthInTokens where the blocks for the terms are as given |
static int |
noTimes(int[] blocksOfTerm1,
int[] blocksOfTerm2,
int windowSize,
int documentLengthInTokens)
Counts number of blocks where two terms occur within a block of windowSize in length, in a document of length documentLengthInTokens where the blocks for the terms are as given |
static int |
noTimes(int[] blocksOfTerm1,
int start1,
int end1,
int[] blocksOfTerm2,
int start2,
int end2,
int windowSize,
int documentLengthInTokens)
Counts number of blocks where two terms occur within a block of windowSize in length, in a document of length documentLengthInTokens where the blocks for the terms are as given |
static int |
noTimesNEW(int[] term0Positions,
int[] term1Positions,
int windowSize,
int documentLengthInTokens)
Returns the number of windows that have the both terms occurring, in the order specified. |
static int |
noTimesSameOrder(int[][] blocksOfAllTerms1,
int documentLengthInTokens)
Deprecated. |
static int |
noTimesSameOrder(int[] term0Positions,
int[] term1Positions,
int windowSize,
int documentLengthInTokens)
Returns the number of windows that have the both terms occurring, in the order specified. |
static int |
noTimesSameOrder(int[] term0Positions,
int pos0,
int length0,
int[] term1Positions,
int pos1,
int length1,
int windowSize,
int documentLengthInTokens)
Returns the number of windows that have the both terms occurring, in the order specified. |
static int |
noTimesSameOrderOLD(int[] blocksOfTerm1,
int[] blocksofTerm2,
int windowSize,
int documentLengthInTokens)
number of blocks where |
static void |
windowsForTerms(int[] blocksOfTerm,
int windowSize,
int numberOfNGrams,
int[] windows_for_term)
Sets the number of occurrences of a term in each window, given the specified window size, the number of n-grams in the document, and the blocks of the term. |
static void |
windowsForTerms(int[] blocksOfTerm,
int start,
int end,
int windowSize,
int numberOfNGrams,
int[] windows_for_term)
Sets the number of occurrences of a term in each window, given the specified window size, the number of n-grams in the document, and the blocks of the term. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Distance()
Method Detail |
---|
public static final int noTimes(int[] blocksOfTerm1, int start1, int end1, int[] blocksOfTerm2, int start2, int end2, int windowSize, int documentLengthInTokens)
blocksOfTerm1
- start1
- The start index for the correct blockIds in blocksOfTerm1end1
- The end for the correct blockIds in blocksOfTerm1blocksOfTerm2
- start2
- The start index for the correct blockIds in blocksOfTerm2end2
- The end index for the correct blockIds in blocksOfTerm2windowSize
- documentLengthInTokens
- public static final int noTimes(int[] blocksOfTerm1, int[] blocksOfTerm2, int windowSize, int documentLengthInTokens)
blocksOfTerm1
- blocksOfTerm2
- windowSize
- documentLengthInTokens
- public static final int noTimes(int[][] blocksForEachTerm, int windowSize, int documentLengthInTokens)
blocksForEachTerm
- - array of int[] of blocks for each termwindowSize
- documentLengthInTokens
- public static final void windowsForTerms(int[] blocksOfTerm, int start, int end, int windowSize, int numberOfNGrams, int[] windows_for_term)
blocksOfTerm
- - block occurrences for termstart
- - start index to consider in blocksOfTermend
- - end index to consider in blocksOfTermwindowSize
- - size of each windownumberOfNGrams
- - number of windows in documentwindows_for_term
- - array of length numberOfNGramspublic static final void windowsForTerms(int[] blocksOfTerm, int windowSize, int numberOfNGrams, int[] windows_for_term)
blocksOfTerm
- - block occurrences for termwindowSize
- - size of each windownumberOfNGrams
- - number of windows in documentwindows_for_term
- - array of length numberOfNGramspublic static final int noTimesSameOrder(int[] term0Positions, int[] term1Positions, int windowSize, int documentLengthInTokens)
public static final int noTimesNEW(int[] term0Positions, int[] term1Positions, int windowSize, int documentLengthInTokens)
public static final int noTimesSameOrder(int[] term0Positions, int pos0, int length0, int[] term1Positions, int pos1, int length1, int windowSize, int documentLengthInTokens)
protected static int countTrue(boolean[] in)
@Deprecated public static final int noTimesSameOrder(int[][] blocksOfAllTerms1, int documentLengthInTokens)
public static final int noTimesSameOrderOLD(int[] blocksOfTerm1, int[] blocksofTerm2, int windowSize, int documentLengthInTokens)
public static final int findSmallest(int[] x, int[] y)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |