parxivScore.py
def _scoreTitle(self, k):
    """
      Calculate score for title
      
      Parameters
      ----------
      k : int
          Identifier for article.
    """
    score = 0.0
    # Scoring details
    sd = []
    for reg in self._titAbsRegex:
      r = re.findall(reg[0], self.articles[k]["title"])
      score += float(len(r)) * reg[1]
      if len(r) > 0:
        # There is at least one match
        if len(r) > 1:
          # More than one match
          sd.append("%d*(%+d)=%+d" % (len(r), int(reg[1]), len(r)*int(reg[1])))
        else:
          # Only one match
          sd.append("%+d" % (len(r)*int(reg[1])))
        sd[-1] += " (" + reg[0] + ")"
    if len(sd) > 0:
      return score, "Title: " + ', '.join(sd)
    return score, ""

      Calculate score for title
      
      Parameters
      ----------
      k : int
          Identifier for article.
    
Calculate score for title
Parameters

k : int
Identifier for article.
Calculate score for title Parameters k : int Identifier for article .
def _scoreTitle(self, k):
    score = 0.0
    sd = []
    for reg in self._titAbsRegex:
      r = re.findall(reg[0], self.articles[k]["title"])
      score += float(len(r)) * reg[1]
      if len(r) > 0:
        if len(r) > 1:
          sd.append("%d*(%+d)=%+d" % (len(r), int(reg[1]), len(r)*int(reg[1])))
        else:
          sd.append("%+d" % (len(r)*int(reg[1])))
        sd[-1] += " (" + reg[0] + ")"
    if len(sd) > 0:
      return score, "Title: " + ', '.join(sd)
    return score, ""
def _scoreTitle ( self , k ) : score = 0.0 sd = [ ] for reg in self . _titAbsRegex : r = re . findall ( reg [ 0 ] , self . articles [ k ] [ "title" ] ) score += float ( len ( r ) ) * reg [ 1 ] if len ( r ) > 0 : if len ( r ) > 1 : sd . append ( "%d*(%+d)=%+d" % ( len ( r ) , int ( reg [ 1 ] ) , len ( r ) * int ( reg [ 1 ] ) ) ) else : sd . append ( "%+d" % ( len ( r ) * int ( reg [ 1 ] ) ) ) sd [ - 1 ] += " (" + reg [ 0 ] + ")" if len ( sd ) > 0 : return score , "Title: " + ', ' . join ( sd ) return score , ""
Calculate score for title
Parameters
Calculate score for title Parameters
"""
      Calculate score for title
      
      Parameters
      ----------
      k : int
          Identifier for article.
    """ # Scoring details # There is at least one match # More than one match # Only one match
self
k