/** Builds a document scorer by first reading the ranks from a file. * Ranks are saved as doubles (the first double is the rank of document 0 * and so on). * * @param filename the name of the rank file. */ public DecreasingDocumentRankScorer( final String filename ) throws IOException { this( BinIO.loadDoubles( filename ) ); }
/** Builds a document scorer by first reading the ranks from a file. * Ranks are saved as doubles (the first double is the rank of document 0 * and so on). * * @param filename the name of the rank file. */ public DecreasingDocumentRankScorer( final String filename ) throws IOException { this( BinIO.loadDoubles( filename ) ); }
/** Builds a document scorer by first reading the ranks from a file. * Ranks are saved as doubles (the first double is the rank of document 0 * and so on). * * @param filename the name of the rank file. */ public DecreasingDocumentRankScorer( final String filename ) throws IOException { this( BinIO.loadDoubles( filename ) ); }
/** Builds a document scorer by first reading the ranks from a file. * Ranks are saved as doubles (the first double is the rank of document 0 * and so on). * * @param filename the name of the rank file. */ public DocumentRankScorer( final String filename ) throws IOException { this( BinIO.loadDoubles( filename ) ); }
/** Builds a document scorer by first reading the ranks from a file. * Ranks are saved as doubles (the first double is the rank of document 0 * and so on). * * @param filename the name of the rank file. */ public DecreasingDocumentRankScorer( final String filename ) throws IOException { this( BinIO.loadDoubles( filename ) ); }
/** Builds a document scorer by reading the ranks from a file. * Ranks are saved as doubles (the first double is the rank of document 0 * and so on). * * <p>This constructor can be used with an {@link ObjectParser}. * * @param filename the name of the rank file. */ public DocumentRankScorer( final String filename ) throws IOException { this( BinIO.loadDoubles( filename ) ); }
/** Loads elements from a file given by a pathname, storing them in a given big-array fragment. * * @param filename a filename. * @param array an array which will be filled with data from the specified file. * @param offset the index of the first element of {@code array} to be filled. * @param length the number of elements of {@code array} to be filled. * @return the number of elements actually read from the given file (it might be less than {@code length} if the file is too short). */ public static long loadDoubles(final CharSequence filename, final double[][] array, final long offset, final long length) throws IOException { return loadDoubles(new File(filename.toString()), array, offset, length); } /** Loads elements from a file given by a {@link File} object, storing them in a given big array.
/** Loads elements from a file given by a pathname, storing them in a given array. * * @param filename a filename. * @param array an array which will be filled with data from the specified file. * @return the number of elements actually read from the given file (it might be less than the array length if the file is too short). */ public static int loadDoubles(final CharSequence filename, final double[] array) throws IOException { return loadDoubles(new File(filename.toString()), array); } /** Loads elements from a file given by a {@link File} object, storing them in a new array.
/** Loads elements from a file given by a pathname, storing them in a given array fragment. * * @param filename a filename. * @param array an array which will be filled with data from the specified file. * @param offset the index of the first element of {@code array} to be filled. * @param length the number of elements of {@code array} to be filled. * @return the number of elements actually read from the given file (it might be less than {@code length} if the file is too short). */ public static int loadDoubles(final CharSequence filename, final double[] array, final int offset, final int length) throws IOException { return loadDoubles(new File(filename.toString()), array, offset, length); } /** Loads elements from a file given by a {@link File} object, storing them in a given array.
/** Loads elements from a file given by a pathname, storing them in a given big array. * * @param filename a filename. * @param array a big array which will be filled with data from the specified file. * @return the number of elements actually read from the given file (it might be less than the array length if the file is too short). */ public static long loadDoubles(final CharSequence filename, final double[][] array) throws IOException { return loadDoubles(new File(filename.toString()), array); } /** Loads elements from a file given by a {@link File} object, storing them in a new big array.
/** Loads elements from a file given by a filename, storing them in a new array. * * <p>Note that the length of the returned array will be computed * dividing the specified file size by the number of bytes used to * represent each element. * * @param filename a filename. * @return an array filled with the content of the specified file. */ public static double[] loadDoubles(final CharSequence filename) throws IOException { return loadDoubles(new File(filename.toString())); } /** Stores an array fragment to a given data output.