/** Creates a BM25F scorer using parameters specified by strings. * * <p>This constructor has string parameters tha correspond to the arguments of {@link #BM25FScorer(double, StringMap, LongList, Object2DoubleMap)}. * The two middle arguments can be omitted by specifying them as empty. The last argument is represented by a number of * assignments <samp><var>index</var>=<var>b</var></samp>, separated by commas (as if they were multiple arguments), which * will be compacted into a function representing the values of <var>b</var>. */ @SuppressWarnings("unchecked") public BM25FScorer( String... arg ) throws NumberFormatException, FileNotFoundException, IOException, ClassNotFoundException { this( Double.parseDouble( arg[ 0 ] ), // k1 arg[ 1 ].length() == 0 ? null : (StringMap<? extends CharSequence>)BinIO.loadObject( arg[ 1 ] ), // termMap arg[ 2 ].length() == 0 ? null : new SemiExternalGammaList( new InputBitStream( arg[ 2 ] ) ), // frequencies parseBArray( arg ) ); }
/** Creates a BM25F scorer using parameters specified by strings. * * <p>This constructor has string parameters that correspond to the arguments of {@link #BM25FScorer(double, StringMap, LongList, Object2DoubleMap)}. * The two middle arguments can be omitted by specifying them as empty. The last argument is represented by a number of * assignments <samp><var>index</var>=<var>b</var></samp>, separated by commas (as if they were multiple arguments), which * will be compacted into a function representing the values of <var>b</var>. */ @SuppressWarnings("unchecked") public BM25FScorer( String... arg ) throws NumberFormatException, FileNotFoundException, IOException, ClassNotFoundException { this( Double.parseDouble( arg[ 0 ] ), // k1 arg[ 1 ].length() == 0 ? null : (StringMap<? extends CharSequence>)BinIO.loadObject( arg[ 1 ] ), // termMap arg[ 2 ].length() == 0 ? null : new SemiExternalGammaList( new InputBitStream( arg[ 2 ] ) ), // frequencies parseBArray( arg ) ); }