()
FindTerm(true_dict, "synoptists")
    FindTerm(false_dict, "synoptists")
    FindTerm(true_dict, "frontispira")
    FindTerm(false_dict, "frontispira")
FindTerm(true_dict, "synoptists")
    FindTerm(false_dict, "synoptists")
    FindTerm(true_dict, "frontispira")
    FindTerm(false_dict, "frontispira")
FindTerm ( true_dict synoptists ) FindTerm ( false_dict synoptists ) FindTerm ( true_dict frontispira ) FindTerm ( false_dict frontispira )
def main():
    global total_case
    global max_hash_limit, off_set_base, hashf_cnt, hashf_group
    global start_als_cond, length_cond, ignore_UPPER_ratio

    paras = Args()
    InitSettings(paras.args["maxhash"], paras.args["offset"], paras.args["cnthashf"], paras.args["grouphashf"], paras.args["partdata"])
    file_list = getInputList(0)
    AddTrueInput()
    AddFalseInput(file_list)
    print("Number of files:       %7d" % len(file_list))
    print("Number of True cases:  %7d" % len(true_dict))
    print("Number of False cases: %7d" % len(false_dict))
    print("Number of Total cases: %7d" % total_case)
    total_case = len(true_dict) + len(false_dict)
    print("True Ratio: %7.5f False Ratio: %7.5f" % (len(true_dict) / float(total_case), len(false_dict) / float(total_case)))
    print("=====================================")
    # Testing
    """
    FindTerm(true_dict, "synoptists")
    FindTerm(false_dict, "synoptists")
    FindTerm(true_dict, "frontispira")
    FindTerm(false_dict, "frontispira")
    """
    print("ignore_UPPER_ratio %5.3f" % ignore_UPPER_ratio)

    # ....EXP....
    ###all_or_part = ["new_ret_all"]
    # all_or_part = ["new_ret", "new_ret_all"]
    # for sval in all_or_part:
    #     ofset_list  = list(range(1, 3, 1))                                                  # oxxx
    #     hashf_cnt   = 5                                                                     # cX
    #     hashf_group = 5                                                                     # gX
    #     if sval == "new_ret_all":
    #         ignore_UPPER_ratio = 1.0                                                        # igXXX
    #         start_als_cond = list(string.ascii_lowercase)
    #         length_cond    = [l for l in range(61)]
    #     else:
    #         ignore_UPPER_ratio = 0.4                                                        # igXXX
    #         start_als_cond = ["s", "c", "p", "a", "m", "b", "t", "d", "r", "u", "h", "e"]   # st12
    #         length_cond    = [  9,   8,  10,   7,  11,   6,  12,  13,   5,  14,  15,   4]   # len12
    #     exp_name = "%s_ig%03d_st%d_len%d_o%s_c%d_g%d" % (sval, int(ignore_UPPER_ratio * 100),
    #                                                      len(start_als_cond), len(length_cond),
    #                                                      "".join(str(v) for v in ofset_list),
    #                                                      hashf_cnt, hashf_group)
    #     with open(exp_name, "w") as fout:
    #         for test_ho in ofset_list:
    #             gap = 10000
    #             for test_max_hs in list(range(10000, 510000, gap)):
    #                 off_set_base = test_ho
    #                 max_hash_limit = test_max_hs + random.randint(0, gap / 2 - 1)
    #                 fout.write(" ".join(["%10s" % str(val) for val in saveHashFile(paras.args['featurefile'])]) + "\n")
    #         fout.close()
    #     print(exp_name)
    # sys.exit()

    #testJSandPYFeaturParser()
    saveHashFile(paras.args['featurefile'])
    #sys.exit()
    saveFeatureFile(os.path.join(paras.args['datapath'], paras.args['featurefile']), paras.args["limit"])
def main ( ) : global total_case global max_hash_limit , off_set_base , hashf_cnt , hashf_group global start_als_cond , length_cond , ignore_UPPER_ratio paras = Args ( ) InitSettings ( paras . args [ "maxhash" ] , paras . args [ "offset" ] , paras . args [ "cnthashf" ] , paras . args [ "grouphashf" ] , paras . args [ "partdata" ] ) file_list = getInputList ( 0 ) AddTrueInput ( ) AddFalseInput ( file_list ) print ( "Number of files:       %7d" % len ( file_list ) ) print ( "Number of True cases:  %7d" % len ( true_dict ) ) print ( "Number of False cases: %7d" % len ( false_dict ) ) print ( "Number of Total cases: %7d" % total_case ) total_case = len ( true_dict ) + len ( false_dict ) print ( "True Ratio: %7.5f False Ratio: %7.5f" % ( len ( true_dict ) / float ( total_case ) , len ( false_dict ) / float ( total_case ) ) ) print ( "=====================================" ) # Testing print ( "ignore_UPPER_ratio %5.3f" % ignore_UPPER_ratio ) # ....EXP.... ###all_or_part = ["new_ret_all"] # all_or_part = ["new_ret", "new_ret_all"] # for sval in all_or_part: #     ofset_list  = list(range(1, 3, 1))                                                  # oxxx #     hashf_cnt   = 5                                                                     # cX #     hashf_group = 5                                                                     # gX #     if sval == "new_ret_all": #         ignore_UPPER_ratio = 1.0                                                        # igXXX #         start_als_cond = list(string.ascii_lowercase) #         length_cond    = [l for l in range(61)] #     else: #         ignore_UPPER_ratio = 0.4                                                        # igXXX #         start_als_cond = ["s", "c", "p", "a", "m", "b", "t", "d", "r", "u", "h", "e"]   # st12 #         length_cond    = [  9,   8,  10,   7,  11,   6,  12,  13,   5,  14,  15,   4]   # len12 #     exp_name = "%s_ig%03d_st%d_len%d_o%s_c%d_g%d" % (sval, int(ignore_UPPER_ratio * 100), #                                                      len(start_als_cond), len(length_cond), #                                                      "".join(str(v) for v in ofset_list), #                                                      hashf_cnt, hashf_group) #     with open(exp_name, "w") as fout: #         for test_ho in ofset_list: #             gap = 10000 #             for test_max_hs in list(range(10000, 510000, gap)): #                 off_set_base = test_ho #                 max_hash_limit = test_max_hs + random.randint(0, gap / 2 - 1) #                 fout.write(" ".join(["%10s" % str(val) for val in saveHashFile(paras.args['featurefile'])]) + "\n") #         fout.close() #     print(exp_name) # sys.exit() #testJSandPYFeaturParser() saveHashFile ( paras . args [ 'featurefile' ] ) #sys.exit() saveFeatureFile ( os . path . join ( paras . args [ 'datapath' ] , paras . args [ 'featurefile' ] ) , paras . args [ "limit" ] )