@Override protected IterablePosting createFinalPostingIterator( List<IterablePosting> postings, List<EntryStatistics> pointers) throws IOException { return new PhraseIterablePosting( postings.toArray(new IterablePosting[postings.size()]), pointers.toArray(new EntryStatistics[pointers.size()]), false); }
phrase = PhraseIterablePosting.createPhrasePostingList(ps, invIndex, false);
phrase = PhraseIterablePosting.createPhrasePostingList(ps, invIndex, false);
@SuppressWarnings("unchecked") @Test public void testOnePhraseOneDocument() throws Exception { ApplicationSetup.setProperty("termpipelines", ""); Index index = IndexTestUtils.makeIndexBlocks( new String[]{"doc1"}, new String[]{"dramatis personae"}); IterablePosting ip = PhraseIterablePosting.createPhrasePostingList( new String[]{"dramatis", "personae"}, index.getLexicon(), (PostingIndex<Pointer>) index.getInvertedIndex(), true); assertNotNull(ip); assertEquals(0, ip.next()); assertEquals(1, ip.getFrequency()); assertEquals(IterablePosting.EOL, ip.next()); }
@Override protected IterablePosting createFinalPostingIterator( List<IterablePosting> postings, List<EntryStatistics> pointers) throws IOException { return new PhraseIterablePosting( postings.toArray(new IterablePosting[postings.size()]), pointers.toArray(new EntryStatistics[pointers.size()]), false); }
"another term dramatis PeRsOnAe term" //5 }); IterablePosting ip = PhraseIterablePosting.createPhrasePostingList( new String[]{"dramatis", "personae"}, index.getLexicon(), ip = PhraseIterablePosting.createPhrasePostingList( new String[]{"dramatis", "personae"}, index.getLexicon(), ip = PhraseIterablePosting.createPhrasePostingList( new String[]{"dramatis", "term"}, index.getLexicon(), ip = PhraseIterablePosting.createPhrasePostingList( new String[]{"dramatis", "dramatis"}, index.getLexicon(),
public static IterablePosting createPhrasePostingList(Pointer[] ps, PostingIndex<Pointer> invIndex, boolean savePositions) throws IOException { int phraseLength = ps.length; IterablePosting[] ips = new IterablePosting[phraseLength]; for(int i=0;i<phraseLength;i++) { ips[i] = invIndex.getPostings(ps[i]); } return new PhraseIterablePosting(ips, ps, savePositions); }
public static IterablePosting createPhrasePostingList(Pointer[] ps, PostingIndex<Pointer> invIndex, boolean savePositions) throws IOException { int phraseLength = ps.length; IterablePosting[] ips = new IterablePosting[phraseLength]; for(int i=0;i<phraseLength;i++) { ips[i] = invIndex.getPostings(ps[i]); } return new PhraseIterablePosting(ips, ps, savePositions); }
public static IterablePosting createPhrasePostingList(String[] terms, Lexicon<String> lex, PostingIndex<Pointer> invIndex, boolean savePositions) throws IOException { int phraseLength = terms.length; IterablePosting[] ips = new IterablePosting[phraseLength]; Pointer[] ps = new Pointer[phraseLength]; for(int i=0;i<phraseLength;i++) { LexiconEntry le = lex.getLexiconEntry(terms[i]); ips[i] = invIndex.getPostings(ps[i] = (Pointer) le); } return new PhraseIterablePosting(ips, ps, savePositions); } }
public static IterablePosting createPhrasePostingList(String[] terms, Lexicon<String> lex, PostingIndex<Pointer> invIndex, boolean savePositions) throws IOException { int phraseLength = terms.length; IterablePosting[] ips = new IterablePosting[phraseLength]; Pointer[] ps = new Pointer[phraseLength]; for(int i=0;i<phraseLength;i++) { LexiconEntry le = lex.getLexiconEntry(terms[i]); ips[i] = invIndex.getPostings(ps[i] = (Pointer) le); } return new PhraseIterablePosting(ips, ps, savePositions); } }