def get_judge_and_court(case_path): raw_text = open(case_path).read() clean_html_tree, complete_html_tree, clean_html_str, body_text = get_html_from_raw_text(raw_text) judge = get_judge(clean_html_tree, case_path) court = get_court_object(clean_html_tree, case_path=case_path) if judge in judge_stats: if court in judge_stats[judge]: judge_stats[judge][court] += 1 else: judge_stats[judge][court] = 1 else: judge_stats[judge] = {court: 1}
def get_judge_and_court(case_path): raw_text = open(case_path).read() clean_html_tree, complete_html_tree, clean_html_str, body_text = get_html_from_raw_text( raw_text) judge = get_judge(clean_html_tree, case_path) court = get_court_object(clean_html_tree, case_path=case_path) if judge in judge_stats: if court in judge_stats[judge]: judge_stats[judge][court] += 1 else: judge_stats[judge][court] = 1 else: judge_stats[judge] = {court: 1}
def import_law_box_case(case_path): raw_text = open(case_path).read() clean_html_tree, complete_html_tree, clean_html_str, body_text = get_html_from_raw_text(raw_text) citations = get_citations_from_tree(complete_html_tree, case_path) court = get_court_object(clean_html_tree, citations, case_path) if not court and 'review_court_issues' in DEBUG: if 'review_court_issues' in DEBUG: subprocess.Popen(['firefox', 'file://%s' % case_path], shell=False).communicate() raw_input("No court identified! Can we fix this and restart, or just press enter to log it? ") if 'log_bad_courts' in DEBUG: # Write the failed case out to file. with open('missing_courts_post_focus.txt', 'a') as out: out.write('%s\n' % case_path)
def import_law_box_case(case_path): raw_text = open(case_path).read() clean_html_tree, complete_html_tree, clean_html_str, body_text = get_html_from_raw_text( raw_text) citations = get_citations_from_tree(complete_html_tree, case_path) court = get_court_object(clean_html_tree, citations, case_path) if not court and 'review_court_issues' in DEBUG: if 'review_court_issues' in DEBUG: subprocess.Popen(['firefox', 'file://%s' % case_path], shell=False).communicate() raw_input( "No court identified! Can we fix this and restart, or just press enter to log it? " ) if 'log_bad_courts' in DEBUG: # Write the failed case out to file. with open('missing_courts_post_focus.txt', 'a') as out: out.write('%s\n' % case_path)