示例#1
0
def main(args):

    # args = ["medical insuranceY5jPHX.txt", 'health policyTlYqX1.txt']
    my_dict = word_dict.word_dict()

    pages = []
    page_lbls = []
    for page in args:
        a_scrape = a_web_scrape()
        a_scrape.one_tok_file(page)
        pages.append(a_scrape)
        page_lbls.append(a_scrape.claim_lbl)
    my_ptree = pruned_ptree(my_dict, depth=(N_depth-1), lbls=ptree.labels(page_lbls))

    for p in pages:
        p.add_to_ptree(my_ptree)

    my_ptree.peruse_tree()
    print 40*'*'
示例#2
0
 def __init__(self, words, depth = 2,  lbls = ptree.labels()):
     super(pruned_ptree, self).__init__(words=words, dent='', depth=depth, lbls=lbls)
     self.memes = []