Examples of OneNodeList


Examples of net.sf.clairv.search.util.OneNodeList

    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;
  }
View Full Code Here

Examples of net.sf.clairv.search.util.OneNodeList

          DocList list = new DocList();
          list.term = keyword;
          list.idf = idf;
          oneTerm = oneTerm.substring(i + 1, oneTerm.length() - 1);
          token = new StringTokenizer(oneTerm, ":");
          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);
            }
            list.add(nodeList);
          }
          return list;
        }
View Full Code Here

Examples of net.sf.clairv.search.util.OneNodeList

    docList.idf = Float.parseFloat(token.nextToken());

    docListStr = docListStr.substring(i + 1, docListStr.length() - 1);
    token = new StringTokenizer(docListStr, ":");
    while (token.hasMoreTokens()) {
      OneNodeList nodeList = new OneNodeList();
      String oneNodeList = token.nextToken();
      i = oneNodeList.indexOf("<");
      String nodeid = oneNodeList.substring(0, i);
      nodeList.nodeid = nodeid;
      StringTokenizer docToken = new StringTokenizer(oneNodeList.substring(i + 1,
          oneNodeList.length() - 1), "|");
      while (docToken.hasMoreTokens()) {
        String oneDoc = docToken.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;
  }
View Full Code Here

Examples of net.sf.clairv.search.util.OneNodeList

   */
  public static float getTf(String nodeId, int docId, DocList docList) {
    float tf = -1;
    if (docList != null) {
      for (Iterator itr1 = docList.docList.iterator(); itr1.hasNext(); ) {
        OneNodeList l = (OneNodeList) itr1.next();
        if (l.nodeid.equals(nodeId)) {
          for (Iterator itr2 = l.oneNodeDocList.iterator(); itr2.hasNext(); ) {
            Doc d = (Doc) itr2.next();
            if (d.docid == docId) {
              tf = d.tf;
View Full Code Here

Examples of net.sf.clairv.search.util.OneNodeList

   */
  private List collect(DocList docList) {
    List list = new LinkedList();
    if (docList != null) {
      for (Iterator itr1 =  docList.docList.iterator(); itr1.hasNext(); ) {
        OneNodeList l = (OneNodeList)itr1.next();
        for (Iterator itr2 = l.oneNodeDocList.iterator(); itr2.hasNext(); ) {
          Doc d = (Doc) itr2.next();
          ScoreDoc sd = new ScoreDoc();
          sd.setNodeId(l.nodeid);
          sd.setDocId(d.docid);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.