def load_fol(s):
 statements = []
 for (linenum, line) in enumerate(s.splitlines()):
  line = line.strip()
  if (line.startswith('#') or (line == '')):
   continue
  try:
   statements.append(Expression.fromstring(line))
  except Exception:
   raise ValueError(('Unable to parse line %s: %s' % (linenum, line)))
 return statements

def load_fol ( s ) : statements = [ ] for ( linenum , line ) in enumerate ( s . splitlines ( ) ) : line = line . strip ( ) if ( line . startswith ( '#' ) or ( line == '' ) ) : continue try : statements . append ( Expression . fromstring ( line ) ) except Exception : raise ValueError ( ( 'Unable to parse line %s: %s' % ( linenum , line ) ) ) return statements
temporarily duplicated from nltk .