/** Makes a human readable form of this posting */ @Override public String toString() { String F = (fieldsCount > 0) ? ",F[" + ArrayUtils.join(fields, ",") + "]" : ""; //String B = (hasBlocks > 0) ? ",B[" + ArrayUtils.join(blocks, ",") + "]" : ""; return "(" + id + "," + tf + F + ")"; }
/** {@inheritDoc} */ public String toString() { return "(" + id + "," + tf + ",B[" + ArrayUtils.join(positions, ",") + "])"; } }
@Override public String toString() { return "(" + id + "," + tf + ",B[" + ArrayUtils.join(positions, ",") + "])"; } }
@Override public String toString() { return "(" + id + "," + tf + ",F[" + ArrayUtils.join(fieldFrequencies, ",") + "])"; } }
/** {@inheritDoc} */ public String toString() { return "(" + id + "," + tf + ",F[" + ArrayUtils.join(fieldFrequencies, ",") + "])"; } }
/** {@inheritDoc} */ public String toString() { return "(" + id + "," + tf + ",B[" + ArrayUtils.join(positions, ",") + "])"; } }
/** Makes a human readable form of this posting */ @Override public String toString() { //String F = (fieldsCount > 0) ? ",F[" + ArrayUtils.join(fields, ",") + "]" : ""; String B = (hasBlocks > 0) ? ",B[" + ArrayUtils.join(blocks, ",") + "]" : ""; return "(" + id + "," + tf + B + ")"; }
/** Join some strings together. * @param in Strings to join * @param join Character or String to join by */ public static String join (String[] in, String join) { return join(in, join, 0, in.length); } /**
/** Makes a human readable form of this posting */ @Override public String toString() { String F = (fieldsCount > 0) ? ",F[" + ArrayUtils.join(fields, ",") + "]" : ""; //String B = (hasBlocks > 0) ? ",B[" + ArrayUtils.join(blocks, ",") + "]" : ""; return "(" + id + "," + tf + F + ")"; }
@Override public void writeEvaluationResult(PrintWriter out) { //String summary = null; for(String[] line : output) { if (line.length >= 3 && line[0].equals("map") && line[1].equals("all")) { System.out.println("Average Precision: " + Rounding.toString(Double.parseDouble(line[2]), 4)); } out.println(ArrayUtils.join(line, '\t')); } }
@Override public void writeEvaluationResult(PrintWriter out) { //String summary = null; for(String[] line : output) { if (line.length >= 3 && line[0].equals("map") && line[1].equals("all")) { System.out.println("Average Precision: " + Rounding.toString(Double.parseDouble(line[2]), 4)); } out.println(ArrayUtils.join(line, '\t')); } }
@Override public void readInterpolativeCoding(int[] data, int offset, int len, int lo, int hi) throws IOException { String oldpos = position(); in.readInterpolativeCoding(data, offset, len,lo, hi); logger.debug(oldpos + "readInterpolativeCoding("+ArrayUtils.join(new int[]{offset, len, lo, hi}, ",")+")=["+ArrayUtils.join(data, ",")+"] " + position()); }
/** Print the contents of the meta index */ @SuppressWarnings("unchecked") public static void printMetaIndex(Index index, String structureName) throws IOException { Iterator<String[]> inputStream = (Iterator<String[]>)index.getIndexStructureInputStream(structureName); while(inputStream.hasNext()) { System.out.println(ArrayUtils.join(inputStream.next(), ", ")); } IndexUtil.close(inputStream); }
@Test public void testFIRETerms() throws Exception { String[] words = decode(new String[]{ "गुज्जरों", "औरमीणा", "समुदाय", "केबीच", "संघर्ष" }); testTokenisation(tokenise(ArrayUtils.join(words, " ")), words); }