本文整理汇总了Java中uk.ac.man.cs.choif.extend.Arrayx类的典型用法代码示例。如果您正苦于以下问题:Java Arrayx类的具体用法?Java Arrayx怎么用?Java Arrayx使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Arrayx类属于uk.ac.man.cs.choif.extend包,在下文中一共展示了Arrayx类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: segment
import uk.ac.man.cs.choif.extend.Arrayx; //导入依赖的package包/类
/**
* Given a document as a list of elementary text blocks
* (usually tokenised sentences), segment the document into n
* coherent topic segments. If n is -1, the algorithm
* will decide the appropriate number of segments by
* monitoring the rate of increase in segment density.
* Creation date: (11/05/99 05:55:46)
* @return String[][] A list of coherent topic segments
* @param String[] A list of elementary text blocks (usually sentences). Each block is a string of space separated tokens.
* @param n int Number of segments to make, if -1 then let the algorithm decide.
* @param s int Size of ranking mask, must be >= 3 and an odd number
*/
//modification par Christine Jacquin le 28/09/10
//avant: méthode final static , maintenant=> rien
public String[][][] segment(final String[][] document, final int n, final int s) {
Debugx.msg("C99", "Context vectors...");
ContextVector[] vectors = normalize(document);
Debugx.msg("C99", "Similarity matrix...");
/*System.out.println("context vector");
for (int i=0; i<vectors.length;i++){
System.out.println(vectors[i]);
}
*/
float[][] sim = similarity(vectors);
vectors = null;
Debugx.msg("C99", "Rank matrix (" + s + "x" + s + " rank mask)...");
float[][] rank = rank(sim, s);
sim = null;
Debugx.msg("C99", "Sum of rank matrix...");
float[][] sum = sum(rank);
rank = null;
Debugx.msg("C99", "Divisive clustering (" + (n==-1 ? "automatic" : "user") + " termination)...");
int[] B = Arrayx.sortAsc(boundaries(sum, n));
sum = null;
Debugx.msg("C99", "Found " + (B.length+1) + " segments...");
return split(document, B);
}
示例2: segment
import uk.ac.man.cs.choif.extend.Arrayx; //导入依赖的package包/类
/**
* Given a document as a list of elementary text blocks
* (usually tokenised sentences), segment the document into n
* coherent topic segments. If n is -1, the algorithm
* will decide the appropriate number of segments by
* monitoring the rate of increase in segment density.
* Creation date: (11/05/99 05:55:46)
* @return String[][] A list of coherent topic segments
* @param String[] A list of elementary text blocks (usually sentences). Each block is a string of space separated tokens.
* @param n int Number of segments to make, if -1 then let the algorithm decide.
* @param s int Size of ranking mask, must be >= 3 and an odd number
*/
public final static String[][][] segment(final String[][] document, final int n, final int s) {
Debugx.msg("C99", "Context vectors...");
ContextVector[] vectors = normalize(document);
Debugx.msg("C99", "Similarity matrix...");
float[][] sim = similarity(vectors);
vectors = null;
Debugx.msg("C99", "Rank matrix (" + s + "x" + s + " rank mask)...");
float[][] rank = rank(sim, s);
sim = null;
Debugx.msg("C99", "Sum of rank matrix...");
float[][] sum = sum(rank);
rank = null;
Debugx.msg("C99", "Divisive clustering (" + (n==-1 ? "automatic" : "user") + " termination)...");
int[] B = Arrayx.sortAsc(boundaries(sum, n));
sum = null;
Debugx.msg("C99", "Found " + (B.length+1) + " segments...");
return split(document, B);
}
示例3: segmentW
import uk.ac.man.cs.choif.extend.Arrayx; //导入依赖的package包/类
/**
* Given a document as a list of elementary text blocks
* (usually tokenised sentences), segment the document into n
* coherent topic segments. If n is -1, the algorithm
* will decide the appropriate number of segments by
* monitoring the rate of increase in segment density.
* Creation date: (11/05/99 05:55:46)
* @return String[][] A list of coherent topic segments
* @param String[] A list of elementary text blocks (usually sentences). Each block is a string of space separated tokens.
* @param n int Number of segments to make, if -1 then let the algorithm decide.
* @param s int Size of ranking mask, must be >= 3 and an odd number
*/
public final static String[][][] segmentW(final String[][] document, final int n, final int s) {
Debugx.msg("C99", "Context vectors...");
ContextVector tf = new ContextVector();
ContextVector[] vectors = normalize(document, tf);
Debugx.msg("C99", "Similarity matrix...");
EntropyVector ev = new EntropyVector(tf);
float[][] sim = similarity(vectors, ev);
vectors = null;
Debugx.msg("C99", "Rank matrix (" + s + "x" + s + " rank mask)...");
float[][] rank = rank(sim, s);
sim = null;
Debugx.msg("C99", "Sum of rank matrix...");
float[][] sum = sum(rank);
rank = null;
Debugx.msg("C99", "Divisive clustering (" + (n==-1 ? "automatic" : "user") + " termination)...");
int[] B = Arrayx.sortAsc(boundaries(sum, n));
sum = null;
Debugx.msg("C99", "Found " + (B.length+1) + " segments...");
return split(document, B);
}
示例4: segmentW
import uk.ac.man.cs.choif.extend.Arrayx; //导入依赖的package包/类
/**
* Given a document as a list of elementary text blocks
* (usually tokenised sentences), segment the document into n
* coherent topic segments. If n is -1, the algorithm
* will decide the appropriate number of segments by
* monitoring the rate of increase in segment density.
* Creation date: (11/05/99 05:55:46)
* @return String[][] A list of coherent topic segments
* @param String[] A list of elementary text blocks (usually sentences). Each block is a string of space separated tokens.
* @param n int Number of segments to make, if -1 then let the algorithm decide.
* @param s int Size of ranking mask, must be >= 3 and an odd number
*/
//modification par Christine Jacquin le 28/09/10
//avant: méthode final static , maintenant=> rien
public String[][][] segmentW(final String[][] document, final int n, final int s) {
Debugx.msg("C99", "Context vectors...");
ContextVector tf = new ContextVector();
ContextVector[] vectors = normalize(document, tf);
/* System.out.println("context vector");
for (int i=0; i<vectors.length;i++){
System.out.println(vectors[i]);
}
*/
Debugx.msg("C99", "Similarity matrix...");
EntropyVector ev = new EntropyVector(tf);
float[][] sim = similarity(vectors, ev);
vectors = null;
Debugx.msg("C99", "Rank matrix (" + s + "x" + s + " rank mask)...");
float[][] rank = rank(sim, s);
sim = null;
Debugx.msg("C99", "Sum of rank matrix...");
float[][] sum = sum(rank);
rank = null;
Debugx.msg("C99", "Divisive clustering (" + (n==-1 ? "automatic" : "user") + " termination)...");
int[] B = Arrayx.sortAsc(boundaries(sum, n));
sum = null;
Debugx.msg("C99", "Found " + (B.length+1) + " segments...");
return split(document, B);
}