Skip to content

Commit

Permalink
Merge pull request #49 from monarch-initiative/fix_typo_methodname
Browse files Browse the repository at this point in the history
change method-name converIndexSetToBitmap to convertIndexSetToBitmap
  • Loading branch information
cmungall committed Feb 7, 2017
2 parents b82917e + 6756ecd commit 2fd1b1f
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ protected EWAHCompressedBitmap getIndividualsBM(EnrichmentQuery q) {
return kb.getIndividualsBM(q.getClassId());
else if (q.getIndividualIds() != null) {
Set<Integer> ixs = q.getIndividualIds().stream().map( x -> kb.getIndividualIndex(x)).collect(Collectors.toSet());
return EWAHUtils.converIndexSetToBitmap(ixs);
return EWAHUtils.convertIndexSetToBitmap(ixs);
}
else {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ protected EWAHCompressedBitmap getDirectProfileBM(ProfileQuery q) {
for (String cid : q.getQueryClassIds()) {
positions.add(knowledgeBase.getClassIndex(cid));
}
return EWAHUtils.converIndexSetToBitmap(positions);
return EWAHUtils.convertIndexSetToBitmap(positions);
}

// given an array of class IDs c1...cn, return an array S1...Sn,
Expand Down Expand Up @@ -114,7 +114,7 @@ protected EWAHCompressedBitmap getNegatedProfileBM(ProfileQuery q) {
int ci = knowledgeBase.getClassIndex(id);
bits.addAll( knowledgeBase.getSubClasses(ci).getPositions() );
}
return EWAHUtils.converIndexSetToBitmap(bits);
return EWAHUtils.convertIndexSetToBitmap(bits);
}

protected EWAHCompressedBitmap getDirectNegatedProfileBM(QueryWithNegation q) {
Expand All @@ -124,7 +124,7 @@ protected EWAHCompressedBitmap getDirectNegatedProfileBM(QueryWithNegation q) {
int ci = knowledgeBase.getClassIndex(id);
bits.add(ci);
}
return EWAHUtils.converIndexSetToBitmap(bits);
return EWAHUtils.convertIndexSetToBitmap(bits);
}

protected Match createMatch(String matchId, String matchLabel, double s) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private EWAHCompressedBitmap getQueryBlanketBM(ProfileQuery q) {
}
}

return onQueryNodesBM.or(EWAHUtils.converIndexSetToBitmap(nodesWithOnParents));
return onQueryNodesBM.or(EWAHUtils.convertIndexSetToBitmap(nodesWithOnParents));
}

// any negated query node that has at least one negated parent;
Expand All @@ -82,7 +82,7 @@ private EWAHCompressedBitmap getQueryNegatedNoTransition(EWAHCompressedBitmap ne
}
}

return EWAHUtils.converIndexSetToBitmap(nodes);
return EWAHUtils.convertIndexSetToBitmap(nodes);
}


Expand Down Expand Up @@ -148,10 +148,10 @@ public MatchSet findMatchProfileImpl(ProfileQuery q) {
}

}
EWAHCompressedBitmap nodesQuPtBM = EWAHUtils.converIndexSetToBitmap(nodesQuPt);
EWAHCompressedBitmap nodesQuPuBM = EWAHUtils.converIndexSetToBitmap(nodesQuPu);
EWAHCompressedBitmap nodesQfPtBM = EWAHUtils.converIndexSetToBitmap(nodesQfPtu);
EWAHCompressedBitmap nodesQfPuBM = EWAHUtils.converIndexSetToBitmap(nodesQfPu);
EWAHCompressedBitmap nodesQuPtBM = EWAHUtils.convertIndexSetToBitmap(nodesQuPt);
EWAHCompressedBitmap nodesQuPuBM = EWAHUtils.convertIndexSetToBitmap(nodesQuPu);
EWAHCompressedBitmap nodesQfPtBM = EWAHUtils.convertIndexSetToBitmap(nodesQfPtu);
EWAHCompressedBitmap nodesQfPuBM = EWAHUtils.convertIndexSetToBitmap(nodesQfPu);


// include subclasses
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ private EWAHCompressedBitmap getQueryBlanketBM(ProfileQuery q) {
}
}

return onQueryNodesBM.or(EWAHUtils.converIndexSetToBitmap(nodesWithOnParents));
return onQueryNodesBM.or(EWAHUtils.convertIndexSetToBitmap(nodesWithOnParents));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ private EWAHCompressedBitmap getDirectProfileBM(Set<String> classIds) {
for (String cid : classIds) {
positions.add(knowledgeBase.getClassIndex(cid));
}
return EWAHUtils.converIndexSetToBitmap(positions);
return EWAHUtils.convertIndexSetToBitmap(positions);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public EWAHCompressedBitmap[] createRandom(int n) {
for (int j=0; j<setLength; j++) {
ibits.add(rand.nextInt(max));
}
bm = EWAHUtils.converIndexSetToBitmap(ibits);
bm = EWAHUtils.convertIndexSetToBitmap(ibits);
// LOG.info("Created random set with length "+setLength);
newbms[i] = bm;
}
Expand Down Expand Up @@ -118,7 +118,7 @@ public EWAHCompressedBitmap[] createRandomWeightedByInstances(int n) {
for (int j=0; j<setLength; j++) {
ibits.add(allClasses.get(rand.nextInt(max)));
}
bm = EWAHUtils.converIndexSetToBitmap(ibits);
bm = EWAHUtils.convertIndexSetToBitmap(ibits);
// LOG.info("Created random set with length "+setLength);
newbms[i] = bm;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public EWAHCompressedBitmap[] createAttributeSets(EWAHCompressedBitmap atts)
throws Exception {

int thing = this.getKnowledgeBase().getRootIndex(); //is this OWL:Thing?
EWAHCompressedBitmap thingBM = EWAHUtils.converIndexSetToBitmap(new HashSet<Integer>(thing));
EWAHCompressedBitmap thingBM = EWAHUtils.convertIndexSetToBitmap(new HashSet<Integer>(thing));

EWAHCompressedBitmap liftAll = new EWAHCompressedBitmap();
EWAHCompressedBitmap[] attrSets = new EWAHCompressedBitmap[numLevels];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public EWAHCompressedBitmap[] createAttributeSets(EWAHCompressedBitmap atts)
private EWAHCompressedBitmap[] createAttributeSetsRecursive(EWAHCompressedBitmap atts, EWAHCompressedBitmap[] derivedAtts) {

int thing = this.getKnowledgeBase().getRootIndex(); //is this OWL:Thing?
EWAHCompressedBitmap thingBM = EWAHUtils.converIndexSetToBitmap(new HashSet<Integer>(thing));
EWAHCompressedBitmap thingBM = EWAHUtils.convertIndexSetToBitmap(new HashSet<Integer>(thing));
EWAHCompressedBitmap[] attrSets = new EWAHCompressedBitmap[atts.cardinality()];

List<Integer> aList = atts.getPositions();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ private EWAHCompressedBitmap[] makeSetofRandomSubsets(EWAHCompressedBitmap atts)
//do this in a while loop instead of for loop
while ((subsetCounter < numSets) ) { //&& (subsetTries < 7*maxNumSets)
Set<Integer> randomSet = makeRandomSubset(atts, setLength);
sets.add(EWAHUtils.converIndexSetToBitmap(randomSet));
sets.add(EWAHUtils.convertIndexSetToBitmap(randomSet));
// LOG.info("Set size="+sets.size());
subsetCounter++;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public EWAHCompressedBitmap[] createAttributeSets(EWAHCompressedBitmap atts)
j++;
}
//make BM from set
bm = EWAHUtils.converIndexSetToBitmap(s);
bm = EWAHUtils.convertIndexSetToBitmap(s);
double finalSumIC= calc.getICStatsForAttributesByBM(bm).getSum();
LOG.info("finalIC= "+(finalSumIC)+" targetIC="+(sumIC-categorySumIC)+" removed |n|="+(atts.cardinality()-bm.cardinality()));
if (bm.cardinality() > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public EWAHCompressedBitmap[] createAttributeSets(EWAHCompressedBitmap atts)
}
}
if (s.size() > 0) {
attrSets[0] = EWAHUtils.converIndexSetToBitmap(s);
attrSets[0] = EWAHUtils.convertIndexSetToBitmap(s);
}

return attrSets;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public EWAHCompressedBitmap getDirectTypes(int individualIndex, int classIndex)
* @return all classes directly instantiated by individual, that are subclasses of classIndex
*/
public EWAHCompressedBitmap getDirectTypes(Set<Integer> clsIndices, int classIndex) {
EWAHCompressedBitmap bm = EWAHUtils.converIndexSetToBitmap(clsIndices);
EWAHCompressedBitmap bm = EWAHUtils.convertIndexSetToBitmap(clsIndices);
EWAHCompressedBitmap subclasses = getSubClasses(classIndex);
return bm.and(subclasses);
}
Expand Down Expand Up @@ -267,7 +267,7 @@ public EWAHCompressedBitmap getDirectIndividuals(int classIndex) {
* @param superClasses
*/
public void setSuperClasses(int clsIndex, Set<Integer> superClasses) {
storedSuperClasses[clsIndex] = EWAHUtils.converIndexSetToBitmap(superClasses);
storedSuperClasses[clsIndex] = EWAHUtils.convertIndexSetToBitmap(superClasses);
}

/**
Expand All @@ -278,7 +278,7 @@ public void setSuperClasses(int clsIndex, Set<Integer> superClasses) {
* @param superClasses
*/
public void setDirectSuperClasses(int clsIndex, Set<Integer> superClasses) {
storedDirectSuperClasses[clsIndex] = EWAHUtils.converIndexSetToBitmap(superClasses);
storedDirectSuperClasses[clsIndex] = EWAHUtils.convertIndexSetToBitmap(superClasses);
}


Expand All @@ -304,7 +304,7 @@ public void setStoredDirectSubClasses(
*/
public void setDirectSubClasses(int clsIndex,
Set<Integer> subClasses) {
storedDirectSubClasses[clsIndex] = EWAHUtils.converIndexSetToBitmap(subClasses);
storedDirectSubClasses[clsIndex] = EWAHUtils.convertIndexSetToBitmap(subClasses);
}

/**
Expand All @@ -313,7 +313,7 @@ public void setDirectSubClasses(int clsIndex,
*/
public void setSubClasses(int clsIndex,
Set<Integer> subClasses) {
storedSubClasses[clsIndex] = EWAHUtils.converIndexSetToBitmap(subClasses);
storedSubClasses[clsIndex] = EWAHUtils.convertIndexSetToBitmap(subClasses);
}


Expand All @@ -327,7 +327,7 @@ public void setSubClasses(int clsIndex,
* @param types
*/
public void setTypes(int individualIndex, Set<Integer> types) {
storedTypes[individualIndex] = EWAHUtils.converIndexSetToBitmap(types);
storedTypes[individualIndex] = EWAHUtils.convertIndexSetToBitmap(types);
}

/**
Expand All @@ -339,23 +339,23 @@ public void setTypes(int individualIndex, Set<Integer> types) {
* @param types
*/
public void setDirectTypes(int individualIndex, Set<Integer> types) {
storedDirectTypes[individualIndex] = EWAHUtils.converIndexSetToBitmap(types);
storedDirectTypes[individualIndex] = EWAHUtils.convertIndexSetToBitmap(types);
}

/**
* @param individualIndex
* @param types
*/
public void setNegatedTypes(int individualIndex, Set<Integer> types) {
storedNegatedTypes[individualIndex] = EWAHUtils.converIndexSetToBitmap(types);
storedNegatedTypes[individualIndex] = EWAHUtils.convertIndexSetToBitmap(types);
}

/**
* @param individualIndex
* @param types
*/
public void setDirectNegatedTypes(int individualIndex, Set<Integer> types) {
storedDirectNegatedTypes[individualIndex] = EWAHUtils.converIndexSetToBitmap(types);
storedDirectNegatedTypes[individualIndex] = EWAHUtils.convertIndexSetToBitmap(types);
}


Expand All @@ -370,7 +370,7 @@ public void setDirectNegatedTypes(int individualIndex, Set<Integer> types) {
* @param individuals
*/
public void setDirectIndividuals(int classIndex, Set<Integer> individuals) {
storedDirectIndividuals[classIndex] = EWAHUtils.converIndexSetToBitmap(individuals);
storedDirectIndividuals[classIndex] = EWAHUtils.convertIndexSetToBitmap(individuals);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class EWAHUtils {
* @param bits - set of bits
* @return Bitmap representation of set of ints
*/
public static EWAHCompressedBitmap converIndexSetToBitmap(Set<Integer> bits) {
public static EWAHCompressedBitmap convertIndexSetToBitmap(Set<Integer> bits) {
EWAHCompressedBitmap bm = new EWAHCompressedBitmap();
ArrayList<Integer> bitlist = new ArrayList<Integer>(bits);
Collections.sort(bitlist); // EWAH assumes sorted, otherwise silent failure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public void testLiftOneAnnotations() throws Exception {
}
//for each individual, the things removed == original
LOG.info("i= "+i+" orig="+origBM.toString()+" removed="+removedCBits.toString()+" in "+derivedBMs.length+" sets");
Assert.assertTrue("Bits missing: "+origBM.andNot(EWAHUtils.converIndexSetToBitmap(removedCBits)), origBM.andNotCardinality(EWAHUtils.converIndexSetToBitmap(removedCBits))==0);
Assert.assertTrue("Bits missing: "+origBM.andNot(EWAHUtils.convertIndexSetToBitmap(removedCBits)), origBM.andNotCardinality(EWAHUtils.convertIndexSetToBitmap(removedCBits))==0);
}
}

Expand Down

0 comments on commit 2fd1b1f

Please sign in to comment.