Package org.terrier.structures

Examples of org.terrier.structures.BasicLexiconEntry


  }
 
  /** Return the LexiconEntry for this Posting */
  public LexiconEntry getLexiconEntry()
  {
    return new BasicLexiconEntry(0, termDf, termTF);
  }
View Full Code Here


    * @param lexiconStream The lexicon output stream to store to. */
  public void storeToStream(LexiconOutputStream<String> lexiconStream) throws IOException
  {
    final String[] terms = tfs.keys(new String[0]);
    Arrays.sort(terms);
    BasicLexiconEntry le = new BasicLexiconEntry();//TODO could use the one without positions
    for (String t : terms)
    {
      le.setTermId(TermCodes.getCode(t));
      le.setStatistics(nts.get(t), tfs.get(t));
      lexiconStream.writeNextEntry(t, le);
    }
  }
View Full Code Here

    assertEquals(1, mqt.length())
    assertEquals(1, mqt.getTerms().length)
    assertEquals(term, mqt.getTerms()[0]);
    assertEquals(1.0d, mqt.getTermWeight(term), 0.0d);
    assertNull(mqt.getStatistics(term));
    EntryStatistics e = new BasicLexiconEntry(2, 1, 100);
    mqt.setTermProperty(term, e);
    assertEquals(2, mqt.getStatistics(term).getTermId());
    assertEquals(1, mqt.getStatistics(term).getDocumentFrequency());
    assertEquals(100, mqt.getStatistics(term).getFrequency());
  }
View Full Code Here

    assertEquals(1, mqt.length())
    assertEquals(1, mqt.getTerms().length)
    assertEquals(term, mqt.getTerms()[0]);
    assertEquals(1.0d, mqt.getTermWeight(term), 0.0d);
    assertNull(mqt.getStatistics(term));
    EntryStatistics e = new BasicLexiconEntry(2, 1, 100);
    mqt.setTermProperty(term, e);
    assertEquals(2, mqt.getStatistics(term).getTermId());
    assertEquals(1, mqt.getStatistics(term).getDocumentFrequency());
    assertEquals(100, mqt.getStatistics(term).getFrequency());
  }
View Full Code Here

    assertEquals(1.0d, mqt.getTermWeight(term2), 0.0d);
   
    assertNull(mqt.getStatistics(term1));
    assertNull(mqt.getStatistics(term2));
       
    EntryStatistics e1 = new BasicLexiconEntry(2, 1, 100);
    EntryStatistics e2 = new BasicLexiconEntry(40, 100, 102);
    mqt.setTermProperty(term1, e1);
    mqt.setTermProperty(term2, e2);
   
    assertEquals(2, mqt.getStatistics(term1).getTermId());
    assertEquals(40, mqt.getStatistics(term2).getTermId());
View Full Code Here

    assertEquals(1, mqt.length())
    assertEquals(1, mqt.getTerms().length)
    assertEquals(term, mqt.getTerms()[0]);
    assertEquals(1.0d, mqt.getTermWeight(term), 0.0d);
    assertNull(mqt.getStatistics(term));
    EntryStatistics e = new BasicLexiconEntry(2, 1, 100);
    mqt.setTermProperty(term, e);
    assertEquals(2, mqt.getStatistics(term).getTermId());
    assertEquals(1, mqt.getStatistics(term).getDocumentFrequency());
    assertEquals(100, mqt.getStatistics(term).getFrequency());
  }
View Full Code Here

    assertEquals(1, mqt.length())
    assertEquals(1, mqt.getTerms().length)
    assertEquals(term, mqt.getTerms()[0]);
    assertEquals(1.0d, mqt.getTermWeight(term), 0.0d);
    assertNull(mqt.getStatistics(term));
    EntryStatistics e = new BasicLexiconEntry(2, 1, 100);
    mqt.setTermProperty(term, e);
    assertEquals(2, mqt.getStatistics(term).getTermId());
    assertEquals(1, mqt.getStatistics(term).getDocumentFrequency());
    assertEquals(100, mqt.getStatistics(term).getFrequency());
  }
View Full Code Here

    assertEquals(1.0d, mqt.getTermWeight(term2), 0.0d);
   
    assertNull(mqt.getStatistics(term1));
    assertNull(mqt.getStatistics(term2));
       
    EntryStatistics e1 = new BasicLexiconEntry(2, 1, 100);
    EntryStatistics e2 = new BasicLexiconEntry(40, 100, 102);
    mqt.setTermProperty(term1, e1);
    mqt.setTermProperty(term2, e2);
   
    assertEquals(2, mqt.getStatistics(term1).getTermId());
    assertEquals(40, mqt.getStatistics(term2).getTermId());
View Full Code Here

TOP

Related Classes of org.terrier.structures.BasicLexiconEntry

Copyright © 2018 www.massapicom. 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.