Exemplo n.º 1
0
def main ():
  path = sys.argv[1]

  if os.path.isdir(path):
    exsto.test_filter(path)
  else:
    with open(path, 'r') as f:
      for line in f.readlines():
        meta = json.loads(line)
        print exsto.pretty_print(exsto.filter_quotes(meta["text"]))
Exemplo n.º 2
0
def main():
    path = sys.argv[1]

    if os.path.isdir(path):
        exsto.test_filter(path)
    else:
        with open(path, 'r') as f:
            for line in f.readlines():
                meta = json.loads(line)
                print exsto.pretty_print(exsto.filter_quotes(meta["text"]))
Exemplo n.º 3
0
def main():
    global DEBUG
    path = sys.argv[1]

    with open(path, 'r') as f:
        for line in f.readlines():
            meta = json.loads(line)

            for graf_text in exsto.filter_quotes(meta["text"]):
                try:
                    for sent in exsto.parse_graf(meta["id"], graf_text):
                        print exsto.pretty_print(sent)
                except (IndexError) as e:
                    if DEBUG:
                        print "IndexError: " + str(e)
                        print graf_text
Exemplo n.º 4
0
Arquivo: etl.py Projeto: aimran/exsto
def main ():
  global DEBUG
  path = sys.argv[1]

  with open(path, 'r') as f:
    for line in f.readlines():
      meta = json.loads(line)

      for graf_text in exsto.filter_quotes(meta["text"]):
        try:
          for sent in exsto.parse_graf(meta["id"], graf_text):
            print exsto.pretty_print(sent)
        except (IndexError) as e:
          if DEBUG:
            print "IndexError: " + str(e)
            print graf_text
Exemplo n.º 5
0
def main():
  global DEBUG

  path = sys.argv[1]

  with open(path, 'r') as f:
    for line in f.readlines():
      meta = json.loads(line)
      base = 0

      for graf_text in exsto.filter_quotes(meta["text"]):
        if DEBUG:
          print graf_text

        grafs, new_base = exsto.parse_graf(meta["id"], graf_text, base)
        base = new_base

        for graf in grafs:
          print exsto.pretty_print(graf)