本文整理汇总了Java中org.apache.lucene.util.OpenBitSet.get方法的典型用法代码示例。如果您正苦于以下问题:Java OpenBitSet.get方法的具体用法?Java OpenBitSet.get怎么用?Java OpenBitSet.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.lucene.util.OpenBitSet
的用法示例。
在下文中一共展示了OpenBitSet.get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: executePara
import org.apache.lucene.util.OpenBitSet; //导入方法依赖的package包/类
private void executePara(int attribute) throws CouldNotReceiveResultException, ColumnNameMismatchException {
for (OpenBitSet lhs : this.lhss.get(attribute)) {
if (lhs.get(attribute)) {
continue;
}
IntList bits = new IntArrayList();
int lastIndex = lhs.nextSetBit(0);
while (lastIndex != -1) {
bits.add(lastIndex);
lastIndex = lhs.nextSetBit(lastIndex + 1);
}
FunctionalDependencyGroup2 fdg = new FunctionalDependencyGroup2(attribute, bits);
this.fdrr.receiveResult((fdg.buildDependency(this.relationName, this.columns)));
this.result.add(fdg);
}
}
开发者ID:HPI-Information-Systems,项目名称:metanome-algorithms,代码行数:19,代码来源:FunctionalDependencyGenerator.java
示例2: extendWith
import org.apache.lucene.util.OpenBitSet; //导入方法依赖的package包/类
private OpenBitSet extendWith(OpenBitSet lhs, int rhs, int extensionAttr) {
if (lhs.get(extensionAttr) || // Triviality: AA->C cannot be valid, because A->C is invalid
(rhs == extensionAttr) || // Triviality: AC->C cannot be valid, because A->C is invalid
this.posCover.containsFdOrGeneralization(lhs, extensionAttr) || // Pruning: If A->B, then AB->C cannot be minimal // TODO: this pruning is not used in the Inductor when inverting the negCover; so either it is useless here or it is useful in the Inductor?
((this.posCover.getChildren() != null) && (this.posCover.getChildren()[extensionAttr] != null) && this.posCover.getChildren()[extensionAttr].isFd(rhs)))
// Pruning: If B->C, then AB->C cannot be minimal
return null;
OpenBitSet childLhs = lhs.clone(); // TODO: This clone() could be avoided when done externally
childLhs.set(extensionAttr);
// TODO: Add more pruning here
// if contains FD: element was a child before and has already been added to the next level
// if contains Generalization: element cannot be minimal, because generalizations have already been validated
if (this.posCover.containsFdOrGeneralization(childLhs, rhs)) // Pruning: If A->C, then AB->C cannot be minimal
return null;
return childLhs;
}
示例3: specializePositiveCover
import org.apache.lucene.util.OpenBitSet; //导入方法依赖的package包/类
protected int specializePositiveCover(FDTree posCoverTree, OpenBitSet lhs, int rhs) {
int newFDs = 0;
List<OpenBitSet> specLhss = posCoverTree.getFdAndGeneralizations(lhs, rhs);
for (OpenBitSet specLhs : specLhss) {
posCoverTree.removeFunctionalDependency(specLhs, rhs);
if (specLhs.cardinality() == posCoverTree.getMaxDepth())
continue;
for (int attr = this.numAttributes - 1; attr >= 0; attr--) { // TODO: Is iterating backwards a good or bad idea?
if (!lhs.get(attr) && (attr != rhs)) {
specLhs.set(attr);
if (!posCoverTree.containsFdOrGeneralization(specLhs, rhs)) {
posCoverTree.addFunctionalDependency(specLhs, rhs);
newFDs++;
}
specLhs.clear(attr);
}
}
}
return newFDs;
}
示例4: next
import org.apache.lucene.util.OpenBitSet; //导入方法依赖的package包/类
public boolean next() throws IOException
{
try
{
if (!in.next())
{
return false;
}
OpenBitSet deletedDocuments = getDeletedDocuments();
while (deletedDocuments.get(in.doc()))
{
if (!in.next())
{
return false;
}
}
// Not masked
return true;
}
catch(IOException ioe)
{
s_logger.error("Error reading docs for "+id);
throw ioe;
}
}
示例5: skipTo
import org.apache.lucene.util.OpenBitSet; //导入方法依赖的package包/类
public boolean skipTo(int i) throws IOException
{
if (!in.skipTo(i))
{
return false;
}
OpenBitSet deletedDocuments = getDeletedDocuments();
while (deletedDocuments.get(in.doc()))
{
if (!in.next())
{
return false;
}
}
return true;
}
示例6: doTask
import org.apache.lucene.util.OpenBitSet; //导入方法依赖的package包/类
private void doTask(AgreeSet as) {
OpenBitSet value = as.getAttributes();
DifferenceSet ds = new DifferenceSet();
for (int i = 0; i < numberOfAttributes; i++) {
if (!value.get(i)) {
ds.add(i);
}
}
this.returnValue.add(ds);
}
示例7: executeMax_Set_Task
import org.apache.lucene.util.OpenBitSet; //导入方法依赖的package包/类
private void executeMax_Set_Task(int currentJob) {
MAX_SET result = new MAX_SET(currentJob);
for (AgreeSet a : this.agreeSets) {
OpenBitSet content = a.getAttributes();
if (content.get(currentJob)) {
continue;
}
result.addCombination(content);
}
result.finalize();
this.maxSet.add(result);
}
示例8: extendWith
import org.apache.lucene.util.OpenBitSet; //导入方法依赖的package包/类
private OpenBitSet extendWith(OpenBitSet ucc, int extensionAttr) {
if (ucc.get(extensionAttr))
return null;
OpenBitSet childUCC = ucc.clone();
childUCC.set(extensionAttr);
if (this.posCover.containsUCCOrGeneralization(childUCC))
return null;
// if (this.negCover.containsUCCOrSpecialization(childUCC)) // TODO: May be needed?
// return null;
return childUCC;
}
示例9: specializePositiveCover
import org.apache.lucene.util.OpenBitSet; //导入方法依赖的package包/类
protected int specializePositiveCover(OpenBitSet nonUCC, UCCList nonUCCs) {
int numAttributes = this.posCover.getChildren().length;
int newUCCs = 0;
List<OpenBitSet> specUCCs;
if (!(specUCCs = this.posCover.getUCCAndGeneralizations(nonUCC)).isEmpty()) { // TODO: May be "while" instead of "if"?
for (OpenBitSet specUCC : specUCCs) {
this.posCover.removeUniqueColumnCombination(specUCC);
if ((this.posCover.getMaxDepth() > 0) && (specUCC.cardinality() >= this.posCover.getMaxDepth()))
continue;
for (int attr = numAttributes - 1; attr >= 0; attr--) {
if (!nonUCC.get(attr)) {
specUCC.set(attr);
if (!this.posCover.containsUCCOrGeneralization(specUCC)) {
this.posCover.addUniqueColumnCombination(specUCC);
newUCCs++;
// If dynamic memory management is enabled, frequently check the memory consumption and trim the positive cover if it does not fit anymore
this.memoryGuardian.memoryChanged(1);
this.memoryGuardian.match(this.negCover, this.posCover, nonUCCs);
}
specUCC.clear(attr);
}
}
}
}
return newUCCs;
}
示例10: specializePositiveCover
import org.apache.lucene.util.OpenBitSet; //导入方法依赖的package包/类
protected void specializePositiveCover(FDTree posCoverTree, OpenBitSet lhs, int rhs) {
List<OpenBitSet> specLhss = null;
specLhss = posCoverTree.getFdAndGeneralizations(lhs, rhs);
for (OpenBitSet specLhs : specLhss) {
posCoverTree.removeFunctionalDependency(specLhs, rhs);
for (int attr = this.numAttributes - 1; attr >= 0; attr--) {
if (!lhs.get(attr) && (attr != rhs)) {
specLhs.set(attr);
if (!posCoverTree.containsFdOrGeneralization(specLhs, rhs))
posCoverTree.addFunctionalDependency(specLhs, rhs);
specLhs.clear(attr);
}
}
}
}
示例11: specializePositiveCover
import org.apache.lucene.util.OpenBitSet; //导入方法依赖的package包/类
protected int specializePositiveCover(OpenBitSet lhs, int rhs, FDList nonFds) {
int numAttributes = this.posCover.getChildren().length;
int newFDs = 0;
List<OpenBitSet> specLhss;
if (!(specLhss = this.posCover.getFdAndGeneralizations(lhs, rhs)).isEmpty()) { // TODO: May be "while" instead of "if"?
for (OpenBitSet specLhs : specLhss) {
this.posCover.removeFunctionalDependency(specLhs, rhs);
if ((this.posCover.getMaxDepth() > 0) && (specLhs.cardinality() >= this.posCover.getMaxDepth()))
continue;
for (int attr = numAttributes - 1; attr >= 0; attr--) { // TODO: Is iterating backwards a good or bad idea?
if (!lhs.get(attr) && (attr != rhs)) {
specLhs.set(attr);
if (!this.posCover.containsFdOrGeneralization(specLhs, rhs)) {
this.posCover.addFunctionalDependency(specLhs, rhs);
newFDs++;
// If dynamic memory management is enabled, frequently check the memory consumption and trim the positive cover if it does not fit anymore
this.memoryGuardian.memoryChanged(1);
this.memoryGuardian.match(this.negCover, this.posCover, nonFds);
}
specLhs.clear(attr);
}
}
}
}
return newFDs;
}
示例12: grow
import org.apache.lucene.util.OpenBitSet; //导入方法依赖的package包/类
public void grow(OpenBitSet lhs, FDTree fdTree) {
// Add specializations of all nodes an mark them as isFD, but if specialization exists, then it is invalid and should not be marked; only add specializations of nodes not marked as isFD!
OpenBitSet rhs = this.rhsAttributes;
OpenBitSet invalidRhs = rhs.clone();
invalidRhs.remove(this.rhsFds);
// Add specializations that are not invalid
if (invalidRhs.cardinality() > 0) {
for (int extensionAttr = 0; extensionAttr < this.numAttributes; extensionAttr++) {
if (lhs.get(extensionAttr) || rhs.get(extensionAttr))
continue;
lhs.set(extensionAttr);
fdTree.addFunctionalDependencyIfNotInvalid(lhs, invalidRhs);
lhs.clear(extensionAttr);
}
}
// Traverse children and let them add their specializations
if (this.children != null) {
for (int childAttr = 0; childAttr < this.numAttributes; childAttr++) {
FDTreeElement element = this.children[childAttr];
if (element != null) {
lhs.set(childAttr);
element.grow(lhs, fdTree);
lhs.clear(childAttr);
}
}
}
}
示例13: read
import org.apache.lucene.util.OpenBitSet; //导入方法依赖的package包/类
public int read(int[] docs, int[] freqs) throws IOException
{
int[] innerDocs = new int[docs.length];
int[] innerFreq = new int[docs.length];
int count = in.read(innerDocs, innerFreq);
// Is the stream exhausted
if (count == 0)
{
return 0;
}
OpenBitSet deletedDocuments = getDeletedDocuments();
while (allDeleted(innerDocs, count, deletedDocuments))
{
count = in.read(innerDocs, innerFreq);
// Is the stream exhausted
if (count == 0)
{
return 0;
}
}
// Add non deleted
int insertPosition = 0;
for (int i = 0; i < count; i++)
{
if (!deletedDocuments.get(innerDocs[i]))
{
docs[insertPosition] = innerDocs[i];
freqs[insertPosition] = innerFreq[i];
insertPosition++;
}
}
return insertPosition;
}
示例14: allDeleted
import org.apache.lucene.util.OpenBitSet; //导入方法依赖的package包/类
private boolean allDeleted(int[] docs, int fillSize, OpenBitSet deletedDocuments)
{
for (int i = 0; i < fillSize; i++)
{
if (!deletedDocuments.get(docs[i]))
{
return false;
}
}
return true;
}
示例15: execute
import org.apache.lucene.util.OpenBitSet; //导入方法依赖的package包/类
public List<FunctionalDependencyGroup2> execute(List<DifferenceSet> differenceSets, int numberOfAttributes)
throws CouldNotReceiveResultException, ColumnNameMismatchException {
if (this.timeMesurement) {
this.startTime();
}
List<FunctionalDependencyGroup2> result = new LinkedList<FunctionalDependencyGroup2>();
for (int attribute = 0; attribute < numberOfAttributes; attribute++) {
List<DifferenceSet> tempDiffSet = new LinkedList<DifferenceSet>();
// Compute DifferenceSet modulo attribute (line 3 - Fig5 - FastFDs)
for (DifferenceSet ds : differenceSets) {
OpenBitSet obs = ds.getAttributes().clone();
if (!obs.get(attribute)) {
continue;
} else {
obs.flip(attribute);
tempDiffSet.add(new DifferenceSet(obs));
}
}
// check new DifferenceSet (line 4 + 5 - Fig5 - FastFDs)
if (tempDiffSet.size() == 0) {
this.addFdToReceivers(new FunctionalDependencyGroup2(attribute, new IntArrayList()));
} else if (this.checkNewSet(tempDiffSet)) {
List<DifferenceSet> copy = new LinkedList<DifferenceSet>();
copy.addAll(tempDiffSet);
this.doRecusiveCrap(attribute, this.generateInitialOrdering(tempDiffSet), copy, new IntArrayList(), tempDiffSet,
result);
}
}
if (this.timeMesurement) {
this.stopTime();
}
return result;
}