parxivScore.py
def _loadScoringData(self, fn):
    """
      Load the scoring details from a file.
      
      Parameters
      ----------
      fn : string
          The name of the file holding the
          scoring details.
    """
    try:
      open(fn)
    except IOError, e:
      print
      print "ERROR:"
      print "   Could not open configuration file: ", fn
      print "   Check filanme."
      print
      raise e
    self._titAbsRegex = []
    for l in self._extractSection(fn, "Buzzwords"):
      r = re.match("\s*\"(.*)\"\s+(.*)", l)
      if r is None:
        continue
      self._titAbsRegex.append((r.group(1), float(r.group(2))))
    
    self._authors = []
    for l in self._extractSection(fn, "Authors"):
      r = re.match("\s*\"(.*)\"\s+(.*)", l)
      if r is None:
        continue
      # Split author names and initials
      self._authors.append(tuple(map(str.strip, r.group(1).split(','))) + (float(r.group(2)),))    
    
    self._subcats = []
    for l in self._extractSection(fn, "Subcat"):
      r = re.match("\s*\"(.*)\"\s+(.*)", l)
      if r is None:
        continue
      self._subcats.append((r.group(1), float(r.group(2))))

      Load the scoring details from a file.
      
      Parameters
      ----------
      fn : string
          The name of the file holding the
          scoring details.
    
Load the scoring details from a file.
Parameters

fn : string
The name of the file holding the
scoring details.
Load the scoring details from a file . Parameters fn : string The name of the file holding the scoring details .
def _loadScoringData(self, fn):
    try:
      open(fn)
    except IOError, e:
      print
      print "ERROR:"
      print "   Could not open configuration file: ", fn
      print "   Check filanme."
      print
      raise e
    self._titAbsRegex = []
    for l in self._extractSection(fn, "Buzzwords"):
      r = re.match("\s*\"(.*)\"\s+(.*)", l)
      if r is None:
        continue
      self._titAbsRegex.append((r.group(1), float(r.group(2))))
    self._authors = []
    for l in self._extractSection(fn, "Authors"):
      r = re.match("\s*\"(.*)\"\s+(.*)", l)
      if r is None:
        continue
      self._authors.append(tuple(map(str.strip, r.group(1).split(','))) + (float(r.group(2)),))    
    self._subcats = []
    for l in self._extractSection(fn, "Subcat"):
      r = re.match("\s*\"(.*)\"\s+(.*)", l)
      if r is None:
        continue
      self._subcats.append((r.group(1), float(r.group(2))))
def _loadScoringData ( self , fn ) : try : open ( fn ) except IOError , e : print print "ERROR:" print "   Could not open configuration file: " , fn print "   Check filanme." print raise e self . _titAbsRegex = [ ] for l in self . _extractSection ( fn , "Buzzwords" ) : r = re . match ( "\s*\"(.*)\"\s+(.*)" , l ) if r is None : continue self . _titAbsRegex . append ( ( r . group ( 1 ) , float ( r . group ( 2 ) ) ) ) self . _authors = [ ] for l in self . _extractSection ( fn , "Authors" ) : r = re . match ( "\s*\"(.*)\"\s+(.*)" , l ) if r is None : continue self . _authors . append ( tuple ( map ( str . strip , r . group ( 1 ) . split ( ',' ) ) ) + ( float ( r . group ( 2 ) ) , ) ) self . _subcats = [ ] for l in self . _extractSection ( fn , "Subcat" ) : r = re . match ( "\s*\"(.*)\"\s+(.*)" , l ) if r is None : continue self . _subcats . append ( ( r . group ( 1 ) , float ( r . group ( 2 ) ) ) )
Load the scoring details from a file.
Load the scoring details from a file .
"""
      Load the scoring details from a file.
      
      Parameters
      ----------
      fn : string
          The name of the file holding the
          scoring details.
    """ # Split author names and initials
self
fn