示例#1
0
文件: main.py 项目: hausdorf/keywords
def main():
  authorkey,combinedkey,readerkey = data.trainingKeys()

  i = 0
  for path,f,doc in data.walkTrainDataDoc():
    print doc

    print i
    i += 1
示例#2
0
def answerhist():
  trainingkeylist = map(lambda (x,y,key): key, data.trainingKeys())

  hist = []
  for key in trainingkeylist:
    for docname,answers in key.items():
      for a in answers:
        hist.append(filter(lambda x: ord(x) < 128, a))

  return hist
示例#3
0
文件: viz.py 项目: hausdorf/keywords
def assembleAllPages():
  """
  Assembles all training documents as marked-up HTML
  """

  authorkey,combinedkey,readerkey = data.trainingKeys()
  keydict = {'authorkey': authorkey, 'combinedkey': combinedkey,
      'readerkey': readerkey}

  for path,f,doc in data.walkTrainDataDoc():
    page = assemblePage(path, f, doc, keydict)