protected void loadScorefile(int numDocs, String inputFile, final int column) { logger.info("Opening listofscores feature file " + inputFile); try { staticScores = new double[numDocs]; BufferedReader br = Files.openFileReader(inputFile); String line = null; int i=0; TerrierTimer tt = new TerrierTimer("Loading score file", numDocs); tt.start(); while((line = br.readLine()) != null) { String[] parts = SPLIT_SPACE.split(line, column+1); staticScores[i++] = Double.parseDouble(parts[column -1]); tt.increment(); } tt.finished(); br.close(); } catch (Exception e) { logger.error("Problem opening file: \""+inputFile+"\"", e); } }
protected void loadScorefile(int numDocs, String inputFile, final int column) { logger.info("Opening listofscores feature file " + inputFile); try { staticScores = new double[numDocs]; BufferedReader br = Files.openFileReader(inputFile); String line = null; int i=0; TerrierTimer tt = new TerrierTimer("Loading score file", numDocs); tt.start(); while((line = br.readLine()) != null) { String[] parts = SPLIT_SPACE.split(line, column+1); staticScores[i++] = Double.parseDouble(parts[column -1]); tt.increment(); } tt.finished(); br.close(); } catch (Exception e) { logger.error("Problem opening file: \""+inputFile+"\"", e); } }
protected void initialise(IndexOnDisk index, String structureName) throws IOException { logger.debug("Loading document lengths for " + structureName + " structure into memory. NB: The following stacktrace IS NOT AN Exception", new Exception("THIS IS **NOT** AN EXCEPTION")); docLengths = new int[this.size()]; int i=0; Iterator<DocumentIndexEntry> iter = new FSADocumentIndexIterator(index, structureName); TerrierTimer tt = new TerrierTimer("Loading "+structureName+ " document lengths", this.size());tt.start(); while(iter.hasNext()) { docLengths[i++] = iter.next().getDocumentLength(); tt.increment(); } tt.finished(); IndexUtil.close(iter); } /**
protected void initialise(IndexOnDisk index, String structureName) throws IOException { logger.debug("Loading document lengths for " + structureName + " structure into memory. NB: The following stacktrace IS NOT AN Exception", new Exception("THIS IS **NOT** AN EXCEPTION")); docLengths = new int[this.size()]; int i=0; Iterator<DocumentIndexEntry> iter = new FSADocumentIndexIterator(index, structureName); TerrierTimer tt = new TerrierTimer("Loading "+structureName+ " document lengths", this.size());tt.start(); while(iter.hasNext()) { docLengths[i++] = iter.next().getDocumentLength(); tt.increment(); } tt.finished(); IndexUtil.close(iter); } /**
@Override protected void initialise(IndexOnDisk index, String structureName) throws IOException { logger.debug("Loading document + field lengths for " + structureName + " structure into memory. NB: The following stacktrace IS NOT AN Exception", new Exception("THIS IS **NOT** AN EXCEPTION")); docLengths = new int[this.size()]; fieldLengths = new int[this.size()][]; int i=0; Iterator<DocumentIndexEntry> iter = new FSADocumentIndexIterator(index, structureName); TerrierTimer tt = new TerrierTimer("Loading "+structureName+ " document + field lengths", this.size());tt.start(); while(iter.hasNext()) { FieldDocumentIndexEntry fdie = (FieldDocumentIndexEntry)iter.next(); docLengths[i] = fdie.getDocumentLength(); fieldLengths[i] = fdie.getFieldLengths(); i++; tt.increment(); } tt.finished(); IndexUtil.close(iter); } /**
@Override protected void initialise(IndexOnDisk index, String structureName) throws IOException { logger.debug("Loading document + field lengths for " + structureName + " structure into memory. NB: The following stacktrace IS NOT AN Exception", new Exception("THIS IS **NOT** AN EXCEPTION")); docLengths = new int[this.size()]; fieldLengths = new int[this.size()][]; int i=0; Iterator<DocumentIndexEntry> iter = new FSADocumentIndexIterator(index, structureName); TerrierTimer tt = new TerrierTimer("Loading "+structureName+ " document + field lengths", this.size());tt.start(); while(iter.hasNext()) { FieldDocumentIndexEntry fdie = (FieldDocumentIndexEntry)iter.next(); docLengths[i] = fdie.getDocumentLength(); fieldLengths[i] = fdie.getFieldLengths(); i++; tt.increment(); } tt.finished(); IndexUtil.close(iter); } /**
tt.increment(numPostingsForTerm);
tt.increment(numPostingsForTerm);