Tabnine Logo
PhraseQueue
Code IndexAdd Tabnine to your IDE (free)

How to use
PhraseQueue
in
org.apache.lucene.search

Best Java code snippets using org.apache.lucene.search.PhraseQueue (Showing top 20 results out of 315)

origin: org.apache.lucene/lucene-core

SloppyPhraseMatcher(PhraseQuery.PostingsAndFreq[] postings, int slop, float matchCost, boolean captureLeadMatch) {
 super(approximation(postings), matchCost);
 this.slop = slop;
 this.numPostings = postings.length;
 this.captureLeadMatch = captureLeadMatch;
 pq = new PhraseQueue(postings.length);
 phrasePositions = new PhrasePositions[postings.length];
 for (int i = 0; i < postings.length; ++i) {
  phrasePositions[i] = new PhrasePositions(postings[i].postings, postings[i].position, i, postings[i].terms);
 }
}
origin: org.apache.lucene/lucene-core

/** Fill the queue (all pps are already placed */
private void fillQueue() {
 pq.clear();
 for (PhrasePositions pp : phrasePositions) {  // iterate cyclic list: done once handled max
  if (pp.position > end) {
   end = pp.position;
  }
  pq.add(pp);
 }
}
origin: org.apache.lucene/lucene-core

 return false;
PhrasePositions pp = pq.pop();
assert pp != null;  // if the pq is not full, then positioned == false
captureLead(pp);
matchLength = end - pp.position;
int next = pq.top().position; 
while (advancePP(pp)) {
 if (hasRpts && !advanceRpts(pp)) {
  pq.add(pp);
  if (matchLength <= slop) {
   return true;
  pp = pq.pop();
  next = pq.top().position;
  assert pp != null;  // if the pq is not full, then positioned == false
  matchLength = end - pp.position;
origin: org.apache.lucene/lucene-core

PhrasePositions pp2 = pq.pop();
rptStack[n++] = pp2;
if (pp2.rptGroup >= 0 
pq.add(rptStack[i]);
origin: lucene/lucene

protected final float phraseFreq() throws IOException {
  pq.clear();
  int end = 0;
  for (PhrasePositions pp = first; pp != null; pp = pp.next) {
    if (pp.position > end)
      end = pp.position;
    pq.put(pp);				  // build pq from list
  boolean done = false;
  do {
    PhrasePositions pp = (PhrasePositions) pq.pop();
    int start = pp.position;
    int next = ((PhrasePositions) pq.top()).position;
    for (int pos = start; pos <= next; pos = pp.position) {
    pq.put(pp);				  // restore pq
  } while (!done);
origin: org.apache.lucene/lucene-core-jfrog

protected final void pqToList() {
 last = first = null;
 while (pq.top() != null) {
  PhrasePositions pp = (PhrasePositions) pq.pop();
  if (last != null) {			  // add next to end of list
   last.next = pp;
  } else
   first = pp;
  last = pp;
  pp.next = null;
 }
}
origin: org.apache.lucene/lucene-core-jfrog

boolean done = (end<0);
while (!done) {
  PhrasePositions pp = (PhrasePositions) pq.pop();
  int start = pp.position;
  int next = ((PhrasePositions) pq.top()).position;
  pq.put(pp);               // restore pq
origin: lucene/lucene

private void sort() {
 pq.clear();
 for (PhrasePositions pp = first; pp != null; pp = pp.next)
  pq.put(pp);
 pqToList();
}
origin: org.apache.lucene/com.springsource.org.apache.lucene

private PhrasePositions flip(PhrasePositions pp, PhrasePositions pp2) {
 int n=0;
 PhrasePositions pp3;
 //pop until finding pp2
 while ((pp3=(PhrasePositions)pq.pop()) != pp2) {
  tmpPos[n++] = pp3;
 }
 //insert back all but pp2
 for (n--; n>=0; n--) {
  pq.insert(tmpPos[n]);
 }
 //insert pp back
 pq.put(pp);
 return pp2;
}
origin: org.apache.lucene/lucene-core-jfrog

  pq.clear();
  for (PhrasePositions pp = first; pp != null; pp = pp.next) {
    pp.firstPosition();
    if (pp.position > end)
      end = pp.position;
    pq.put(pp);         // build pq from list
pq.clear();
for (PhrasePositions pp = first; pp != null; pp = pp.next) {
  if (pp.position > end)
    end = pp.position;
  pq.put(pp);         // build pq from list
 tmpPos = new PhrasePositions[pq.size()];
origin: lucene/lucene

PhraseQueue(int size) {
 initialize(size);
}
origin: lucene/lucene

 protected final float phraseFreq() throws IOException {
  // sort list with pq
  for (PhrasePositions pp = first; pp != null; pp = pp.next) {
   pp.firstPosition();
   pq.put(pp);				  // build pq from list
  }
  pqToList();                      // rebuild list from pq

  int freq = 0;
  do {					  // find position w/ all terms
   while (first.position < last.position) {	  // scan forward in first
  do {
   if (!first.nextPosition())
    return (float)freq;
  } while (first.position < last.position);
  firstToLast();
   }
   freq++;                      // all equal: a match
  } while (last.nextPosition());
 
  return (float)freq;
 }
}
origin: lucene/lucene

protected final void pqToList() {
 last = first = null;
 while (pq.top() != null) {
  PhrasePositions pp = (PhrasePositions) pq.pop();
  if (last != null) {			  // add next to end of list
   last.next = pp;
  } else
   first = pp;
  last = pp;
  pp.next = null;
 }
}
origin: org.apache.lucene/com.springsource.org.apache.lucene

boolean done = (end<0);
while (!done) {
  PhrasePositions pp = (PhrasePositions) pq.pop();
  int start = pp.position;
  int next = ((PhrasePositions) pq.top()).position;
  pq.put(pp);               // restore pq
origin: org.apache.lucene/com.springsource.org.apache.lucene

private void sort() {
 pq.clear();
 for (PhrasePositions pp = first; pp != null; pp = pp.next)
  pq.put(pp);
 pqToList();
}
origin: org.infinispan/infinispan-embedded-query

PhrasePositions pp2 = pq.pop();
rptStack[n++] = pp2;
if (pp2.rptGroup >= 0 
pq.add(rptStack[i]);
origin: org.apache.lucene/lucene-core-jfrog

private PhrasePositions flip(PhrasePositions pp, PhrasePositions pp2) {
 int n=0;
 PhrasePositions pp3;
 //pop until finding pp2
 while ((pp3=(PhrasePositions)pq.pop()) != pp2) {
  tmpPos[n++] = pp3;
 }
 //insert back all but pp2
 for (n--; n>=0; n--) {
  pq.insert(tmpPos[n]);
 }
 //insert pp back
 pq.put(pp);
 return pp2;
}
origin: org.apache.lucene/com.springsource.org.apache.lucene

  pq.clear();
  for (PhrasePositions pp = first; pp != null; pp = pp.next) {
    pp.firstPosition();
    if (pp.position > end)
      end = pp.position;
    pq.put(pp);         // build pq from list
pq.clear();
for (PhrasePositions pp = first; pp != null; pp = pp.next) {
  if (pp.position > end)
    end = pp.position;
  pq.put(pp);         // build pq from list
 tmpPos = new PhrasePositions[pq.size()];
origin: org.apache.lucene/lucene-core-jfrog

PhraseQueue(int size) {
 initialize(size);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

 return false;
PhrasePositions pp = pq.pop();
assert pp != null;  // if the pq is not full, then positioned == false
captureLead(pp);
matchLength = end - pp.position;
int next = pq.top().position; 
while (advancePP(pp)) {
 if (hasRpts && !advanceRpts(pp)) {
  pq.add(pp);
  if (matchLength <= slop) {
   return true;
  pp = pq.pop();
  next = pq.top().position;
  assert pp != null;  // if the pq is not full, then positioned == false
  matchLength = end - pp.position;
org.apache.lucene.searchPhraseQueue

Most used methods

  • <init>
  • clear
  • pop
  • top
  • add
  • initialize
  • put
  • insert
  • size

Popular in Java

  • Creating JSON documents from java classes using gson
  • findViewById (Activity)
  • onRequestPermissionsResult (Fragment)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now