You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
Step1 The datafile is
{8,1,2,0,0;
9,1,1,0,0;
0,1,2,1,7;
0,1,2,1,8}
Step2 I added the following code under the line in 1.
for (int w = 0; w < this.V; w++){
Posting[] postings = this.invertedIndex[w];
System.out.println("word " + w + " appears in "+ postings.length + " docs");
for (Posting posting : postings){
System.out.print("word "+ w +": ("+posting.docID + " ");
}
System.out.println();
}
What is the expected output? What do you see instead?
I expected to see a list of docId for each word. i.e.
word 0 appears in 2 docs
word 0: (0,1)
word 1 appears in 4 docs
word 1: (0,1,2,3)
word 2 appears in 4 docs
word 2: (0,1,2,3)
word 3 appears in 2 docs
word 3: (2,3)
word 4 appears in 2 docs
word 4: (2,3)
However, I only see the last docId for each word as follows.
word 0 appears in 1 docs
word 0: (1
word 1 appears in 1 docs
word 1: (3
word 2 appears in 1 docs
word 2: (3
word 3 appears in 1 docs
word 3: (3
word 4 appears in 1 docs
word 4: (3
Please provide any additional information below.
Q: What does this code snippet mean?
for (int w = 0; w < this.V; w++){
this.invertedIndex[w] = list[w].toArray(new Posting[0]);//Posting[0]?
}
Original issue reported on code.google.com by [email protected] on 4 Sep 2012 at 9:20
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
[email protected]
on 4 Sep 2012 at 9:20The text was updated successfully, but these errors were encountered: