log.error("Inverted list db does not exist");
}
}
private DocList parseDocList(String docListStr) {
DocList docList = new DocList();
docListStr = docListStr.trim();
int i = docListStr.indexOf("[");
StringTokenizer token = new StringTokenizer(docListStr.substring(0, i));
docList.term = token.nextToken();
docList.idf = Float.parseFloat(token.nextToken());
docListStr = docListStr.substring(i + 1, docListStr.length() - 1);
token = new StringTokenizer(docListStr, ":");
OneNodeList nodeList = new OneNodeList();
while (token.hasMoreTokens()) {
String oneNodeList = token.nextToken();
i = oneNodeList.indexOf("<");
String nodeid = oneNodeList.substring(0, i);
nodeList.nodeid = nodeid;
token = new StringTokenizer(oneNodeList.substring(i + 1,
oneNodeList.length() - 1), "|");
while (token.hasMoreTokens()) {
String oneDoc = token.nextToken();
oneDoc = oneDoc.trim();
StringTokenizer id_token = new StringTokenizer(oneDoc, "*");
Doc doc = new Doc(Integer.parseInt(id_token.nextToken()), Float
.parseFloat(id_token.nextToken()));
nodeList.add(doc);
}
docList.add(nodeList);
}
return docList;
}