Class TRECQrelsInMemory.QrelsHashSet

  • All Implemented Interfaces:
    java.lang.Cloneable
    Enclosing class:
    TRECQrelsInMemory

    public static class TRECQrelsInMemory.QrelsHashSet
    extends java.lang.Object
    implements java.lang.Cloneable
    Models the set of relevant documents for one query.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      gnu.trove.THashSet<java.lang.String> nonRelDocnos
      The ids of the pooled non-relevant documents.
      java.lang.String queryid
      The identifier of the query.
      gnu.trove.TIntHashSet relGrade
      All relevance grades indicated in the qrels.
      gnu.trove.TIntObjectHashMap<gnu.trove.THashSet<java.lang.String>> relGradeDocnosMap
      A hashmap from the relevance grade to a hashset containing ids of documents with the given relevance grade.
    • Constructor Summary

      Constructors 
      Constructor Description
      QrelsHashSet​(java.lang.String _queryid)
      Creates the an instance of the class with a given query identifier.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object clone()
      Creates a clone of the current instance of the class.
      gnu.trove.THashSet<java.lang.String> getAllRelevantDocuments()
      Get all relevant documents regardless of their relevance grades.
      java.lang.String[] getAllRelevantDocumentsToArray()
      Get all relevant documents regardless of their relevance grades.
      int getGrade​(java.lang.String docno, int def)
      get grade
      gnu.trove.THashSet<java.lang.String> getRelevantDocuments​(int grade)
      Get the relevant documents for a given relevance grade.
      java.lang.String[] getRelevantDocumentsToArray​(int grade)
      Get the relevant documents for a given relevance grade.
      void insertNonRelDocno​(java.lang.String docno)
      insert non relevance docno into non-relevance list
      void insertRelDocno​(java.lang.String docno, int grade)
      Add an identifier of a relevant document with its relevance grade.
      boolean isRelevant​(java.lang.String docno)
      Check if a given document is relevant to the associated query.
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • queryid

        public java.lang.String queryid
        The identifier of the query.
      • relGrade

        public gnu.trove.TIntHashSet relGrade
        All relevance grades indicated in the qrels.
      • nonRelDocnos

        public gnu.trove.THashSet<java.lang.String> nonRelDocnos
        The ids of the pooled non-relevant documents.
      • relGradeDocnosMap

        public gnu.trove.TIntObjectHashMap<gnu.trove.THashSet<java.lang.String>> relGradeDocnosMap
        A hashmap from the relevance grade to a hashset containing ids of documents with the given relevance grade.
    • Constructor Detail

      • QrelsHashSet

        public QrelsHashSet​(java.lang.String _queryid)
        Creates the an instance of the class with a given query identifier.
        Parameters:
        _queryid - String the query identifier.
    • Method Detail

      • clone

        public java.lang.Object clone()
        Creates a clone of the current instance of the class.
        Overrides:
        clone in class java.lang.Object
        Returns:
        Object the clone of the current object.
      • isRelevant

        public boolean isRelevant​(java.lang.String docno)
        Check if a given document is relevant to the associated query.
        Parameters:
        docno - The identifier of the given document.
        Returns:
        Returns true if the document is relevant, false otherwise.
      • getGrade

        public int getGrade​(java.lang.String docno,
                            int def)
        get grade
        Parameters:
        docno -
        def -
        Returns:
        grade
      • getAllRelevantDocumentsToArray

        public java.lang.String[] getAllRelevantDocumentsToArray()
        Get all relevant documents regardless of their relevance grades.
        Returns:
        The identifiers of all relevant documents.
      • getAllRelevantDocuments

        public gnu.trove.THashSet<java.lang.String> getAllRelevantDocuments()
        Get all relevant documents regardless of their relevance grades.
        Returns:
        The identifiers of all relevant documents.
      • getRelevantDocumentsToArray

        public java.lang.String[] getRelevantDocumentsToArray​(int grade)
        Get the relevant documents for a given relevance grade.
        Parameters:
        grade - The given relevance grade.
        Returns:
        The identifiers of the relevant documents with the given relevance grade.
      • getRelevantDocuments

        public gnu.trove.THashSet<java.lang.String> getRelevantDocuments​(int grade)
        Get the relevant documents for a given relevance grade.
        Parameters:
        grade - The given relevance grade.
        Returns:
        The identifiers of the relevant documents with the given relevance grade.
      • insertRelDocno

        public void insertRelDocno​(java.lang.String docno,
                                   int grade)
        Add an identifier of a relevant document with its relevance grade.
        Parameters:
        docno - The identifier of the given relevant document.
        grade - The relevance grade of the given relevant document.
      • insertNonRelDocno

        public void insertNonRelDocno​(java.lang.String docno)
        insert non relevance docno into non-relevance list
        Parameters:
        docno -