Module Import alias Assign NameStore Num Assign NameStore Num Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore Num Assign NameStore Num Assign NameStore ListLoad Assign NameStore ListLoad Assign NameStore Dict Assign NameStore Dict Assign NameStore Dict Assign NameStore Dict Assign NameStore Call NameLoad ListLoad Assign NameStore Dict Assign NameStore Dict Assign NameStore Dict Assign NameStore Dict FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Global identifier Global identifier identifier identifier Global identifier identifier Assign NameStore Num Assign NameStore ListLoad Print Str NameLoad Assign NameStore Call NameLoad NameLoad Str For NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr If Call AttributeLoad NameLoad attr Str body Assign NameStore Call AttributeLoad NameLoad attr Str Str Assign NameStore Call AttributeLoad NameLoad attr orelse If Call AttributeLoad NameLoad attr Str body Assign NameStore Call AttributeLoad NameLoad attr Str Str Assign NameStore Call AttributeLoad NameLoad attr orelse If Call AttributeLoad NameLoad attr Str body Assign NameStore Call AttributeLoad NameLoad attr Str Str For NameStore Call AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr Str TryExcept body Assign SubscriptStore SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index Num Index SubscriptLoad NameLoad Index Num Num handlers ExceptHandler type NameLoad body Assign SubscriptStore NameLoad Index SubscriptLoad NameLoad Index Num Dict Assign SubscriptStore SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index Num Index SubscriptLoad NameLoad Index Num Num TryExcept body Assign SubscriptStore SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index Num Index SubscriptLoad NameLoad Index Num Num handlers ExceptHandler type NameLoad body Assign SubscriptStore NameLoad Index SubscriptLoad NameLoad Index Num Dict Assign SubscriptStore SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index Num Index SubscriptLoad NameLoad Index Num Num orelse If Call AttributeLoad NameLoad attr Str body Continue orelse If Call AttributeLoad NameLoad attr Str body Expr Call NameLoad For NameStore Call AttributeLoad NameLoad attr body Expr Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AugAssignAdd NameStore Num If CompareEq BinOpMod NameLoad Num Num body Print BinOpMod Str NameLoad orelse Assign NameStore NameLoad Assign NameStore ListComp Call NameLoad NameLoad comprehension NameStore Call AttributeLoad NameLoad attr If BoolOpOr UnaryOpNot Call AttributeLoad NameLoad attr Call NameLoad SubscriptLoad NameLoad Index Num UnaryOpNot Call AttributeLoad NameLoad attr Call NameLoad SubscriptLoad NameLoad Index Num UnaryOpNot Call AttributeLoad NameLoad attr Call NameLoad SubscriptLoad NameLoad Index Num UnaryOpNot Call AttributeLoad NameLoad attr Call NameLoad SubscriptLoad NameLoad Index Num body If NameLoad body Continue orelse Assign NameStore NameLoad Assign NameStore BinOpAdd BinOpSub SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Num Assign NameStore TupleLoad Call AttributeLoad Str attr ListComp Call NameLoad NameLoad comprehension NameStore Call NameLoad SubscriptLoad NameLoad Index Num BinOpAdd SubscriptLoad NameLoad Index Num Num Call AttributeLoad Str attr ListComp Call NameLoad NameLoad comprehension NameStore Call NameLoad SubscriptLoad NameLoad Index Num BinOpAdd SubscriptLoad NameLoad Index Num Num If NameLoad body Assign SubscriptStore NameLoad Index NameLoad Num Continue If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Assign SubscriptStore NameLoad Index NameLoad Dict Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index NameLoad Num Expr Call AttributeLoad NameLoad attr With Call NameLoad NameLoad Str NameStore body For NameStore Call NameLoad Call AttributeLoad NameLoad attr body Assign TupleStore NameStore NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore Call AttributeLoad Str attr Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Assign NameStore Call AttributeLoad Str attr Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad NameLoad NameLoad NameLoad With Call NameLoad NameLoad Str NameStore body For NameStore Call NameLoad Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad SubscriptLoad NameLoad Index NameLoad Return NameLoad decorator_list FunctionDef arguments args defaults body Expr Str For NameStore Call NameLoad NameLoad Num Num body If Call AttributeLoad NameLoad attr NameLoad body Expr Call NameLoad NameLoad Assign NameStore Num If Call AttributeLoad NameLoad attr NameLoad body For NameStore SubscriptLoad NameLoad Index NameLoad body If Call AttributeLoad NameLoad attr NameLoad body AugAssignAdd SubscriptStore NameLoad Index NameLoad Num orelse Assign SubscriptStore NameLoad Index NameLoad Num decorator_list FunctionDef arguments args NameParam defaults body Global identifier identifier identifier Global identifier Assign NameStore Dict For NameStore Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr body Assign NameStore Num Assign NameStore Num Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr If CompareLtE NameLoad NameLoad body AugAssignAdd NameStore Num If Call AttributeLoad NameLoad attr NameLoad body AugAssignAdd SubscriptStore NameLoad Index NameLoad Num orelse Assign SubscriptStore NameLoad Index NameLoad Num Expr Call NameLoad NameLoad NameLoad While NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore NameLoad Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr If CompareLtE NameLoad NameLoad body If Call AttributeLoad NameLoad attr NameLoad body AugAssignAdd SubscriptStore NameLoad Index NameLoad Num orelse Assign SubscriptStore NameLoad Index NameLoad Num If BoolOpOr BoolOpAnd NameLoad CompareNotEq Call AttributeLoad NameLoad attr Str Num CompareNotEq Call AttributeLoad NameLoad attr Str Num body Pass orelse If BoolOpAnd CompareNotEq Call AttributeLoad NameLoad attr Str Num UnaryOpNot Call NameLoad NameLoad body Pass orelse Expr Call NameLoad NameLoad NameLoad If CompareGt NameLoad Num body Assign NameStore BinOpDiv Num NameLoad For NameStore Call AttributeLoad NameLoad attr body Assign NameStore NameLoad If NameLoad body AugAssignMult NameStore SubscriptLoad NameLoad Index NameLoad If Call AttributeLoad NameLoad attr NameLoad body AugAssignAdd SubscriptStore NameLoad Index NameLoad NameLoad orelse Assign SubscriptStore NameLoad Index NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr TryExcept body Assign NameStore Call AttributeLoad NameLoad attr Str If BoolOpOr CompareGtE NameLoad Num CompareGtE BinOpSub BinOpSub Call NameLoad NameLoad Num NameLoad Num body Return NameLoad orelse Return NameLoad handlers ExceptHandler type NameLoad body If NameLoad body Return NameLoad orelse Return NameLoad decorator_list FunctionDef arguments args NameParam TupleStore NameStore NameStore defaults body Global identifier Global identifier For NameStore Call NameLoad BinOpSub NameLoad Num Num Num body If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Continue For NameStore Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr body Assign NameStore SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index NameLoad Assign NameStore Call NameLoad NameLoad SubscriptLoad NameLoad Index Num Assign NameStore Call NameLoad NameLoad SubscriptLoad NameLoad Index Num If BoolOpAnd NameLoad NameLoad body Assign TupleStore NameStore NameStore NameLoad Assign NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad AugAssignAdd NameStore Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If BoolOpOr Call AttributeLoad NameLoad attr BinOpAdd NameLoad Str Call AttributeLoad NameLoad attr BinOpAdd Str NameLoad CompareNotEq Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd Str NameLoad Str Num body Return NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str If CompareNotEq NameLoad Num body If CompareGt BinOpAdd BinOpSub Call NameLoad Call AttributeLoad NameLoad attr Call NameLoad Call AttributeLoad NameLoad attr Num NameLoad body Return NameLoad Assign NameStore BinOpAdd NameLoad Str Assign NameStore BinOpAdd Str NameLoad If BoolOpOr Call AttributeLoad NameLoad attr NameLoad CompareNotEq Call AttributeLoad NameLoad attr BinOpAdd Str NameLoad Num Call AttributeLoad NameLoad attr NameLoad CompareNotEq Call AttributeLoad NameLoad attr BinOpAdd NameLoad Str Num body Return NameLoad If BoolOpOr Call AttributeLoad NameLoad attr BinOpAdd NameLoad Str CompareNotEq Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd Str NameLoad Str Num NameLoad Num body Assign NameStore Call AttributeLoad NameLoad attr Str Str Num Assign NameStore Call AttributeLoad NameLoad attr Str Str Num Assign NameStore Str orelse Assign NameStore Str orelse Assign NameStore Str Assign NameStore Call NameLoad NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore NameLoad For NameStore Call AttributeLoad NameLoad attr body If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Continue For NameStore Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr body TryExcept body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore NameLoad Break handlers ExceptHandler type NameLoad body Pass If NameLoad body Return TupleLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body If CompareGt Call NameLoad Call AttributeLoad NameLoad attr Num body Return Call AttributeLoad NameLoad attr NameLoad NameLoad Num orelse Assign NameStore ListLoad For NameStore Call AttributeLoad NameLoad attr body If CompareEq NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad Str attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Global identifier identifier Global identifier identifier Assign NameStore ListLoad Assign NameStore ListLoad Assign NameStore ListLoad Assign NameStore Call AttributeLoad SubscriptLoad NameLoad Index Num attr Assign NameStore Call AttributeLoad SubscriptLoad NameLoad Index Num attr Assign NameStore Num For NameStore NameLoad body If Call AttributeLoad NameLoad attr Str body Expr Call AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad AugAssignAdd NameStore Num Assign NameStore Call AttributeLoad Str attr NameLoad Delete SubscriptDel NameLoad Slice Assign NameStore Num For NameStore NameLoad body If Call AttributeLoad NameLoad attr Str body Expr Call AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad AugAssignAdd NameStore Num Assign NameStore Call AttributeLoad Str attr NameLoad Assign NameStore Call NameLoad Call AttributeLoad Str attr NameLoad Call AttributeLoad Str attr NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Assign SubscriptStore NameLoad Index NameLoad Dict Assign SubscriptStore NameLoad Index NameLoad Dict If UnaryOpNot Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr NameLoad body Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index NameLoad Num If UnaryOpNot Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr NameLoad body Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index NameLoad Num decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Global identifier identifier identifier identifier If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Assign SubscriptStore NameLoad Index NameLoad Num AugAssignAdd SubscriptStore NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Assign NameStore BinOpAdd BinOpAdd NameLoad Str NameLoad If Call AttributeLoad NameLoad attr NameLoad body Assign TupleStore NameStore NameStore SubscriptLoad NameLoad Index NameLoad Assign SubscriptStore NameLoad Index NameLoad TupleLoad NameLoad BinOpAdd NameLoad SubscriptLoad NameLoad Index NameLoad orelse Assign SubscriptStore NameLoad Index NameLoad TupleLoad NameLoad SubscriptLoad NameLoad Index NameLoad Assign NameStore NameLoad AugAssignAdd NameStore Num Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Str attr NameLoad Return Call AttributeLoad NameLoad attr Str Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore ListLoad If Call AttributeLoad NameLoad attr NameLoad body Assign NameStore Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Expr Call AttributeLoad NameLoad attr For NameStore NameLoad body TryExcept body Assign NameStore BinOpAdd BinOpAdd Call NameLoad NameLoad Str Call NameLoad Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad body Pass orelse Expr Call AttributeLoad NameLoad attr BinOpAdd Call NameLoad NameLoad Str Return Call AttributeLoad Str attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore ListLoad If Call AttributeLoad NameLoad attr NameLoad body Assign NameStore Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Expr Call AttributeLoad NameLoad attr For NameStore NameLoad body TryExcept body Assign NameStore BinOpAdd BinOpAdd Call NameLoad Call AttributeLoad NameLoad attr NameLoad Str Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad body Pass orelse Expr Call AttributeLoad NameLoad attr BinOpAdd Str Call NameLoad NameLoad Return Call AttributeLoad Str attr NameLoad decorator_list FunctionDef arguments args defaults body Global identifier Global identifier Global identifier If BoolOpAnd CompareLt Call NameLoad AttributeLoad NameLoad attr Num CompareGt Call NameLoad AttributeLoad NameLoad attr Num body Print BinOpMod Str SubscriptLoad AttributeLoad NameLoad attr Index Num Print Str Expr Call AttributeLoad NameLoad attr Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num If CompareGt Call NameLoad AttributeLoad NameLoad attr Num body Assign NameStore Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num If BoolOpAnd CompareEq Call NameLoad AttributeLoad NameLoad attr Num CompareNotEq SubscriptLoad AttributeLoad NameLoad attr Index Num Str CompareNotEq SubscriptLoad AttributeLoad NameLoad attr Index Num Str body Print Str Expr Call AttributeLoad NameLoad attr Num If BoolOpAnd CompareEq Call NameLoad AttributeLoad NameLoad attr Num CompareEq SubscriptLoad AttributeLoad NameLoad attr Index Num Str body Assign NameStore NameLoad If BoolOpAnd CompareEq Call NameLoad AttributeLoad NameLoad attr Num CompareEq SubscriptLoad AttributeLoad NameLoad attr Index Num Str body Assign NameStore NameLoad Print Str NameLoad Print Str NameLoad If UnaryOpNot Call AttributeLoad NameLoad attr Str body AugAssignAdd NameStore Str If UnaryOpNot Call AttributeLoad NameLoad attr Str body AugAssignAdd NameStore Str Assign NameStore BinOpAdd BinOpAdd NameLoad NameLoad Str Assign NameStore BinOpAdd BinOpAdd NameLoad NameLoad Str Assign NameStore BinOpAdd BinOpAdd BinOpAdd NameLoad Str NameLoad Str Expr Call NameLoad NameLoad NameLoad NameLoad decorator_list If CompareEq NameLoad Str body Expr Call NameLoad
N/A N/A sys N/A max_phr_len 10 N/A tot_src_terms 7 N/A X1_only False N/A weight_rules False N/A tight_phrases_only True N/A rule_indx 1 N/A tot_rules_derived 0 N/A srcWrds N/A N/A tgtWrds N/A N/A ruleDict N/A N/A alignDoD N/A N/A revAlignDoD N/A N/A sentInitDoD N/A N/A ppairRulesSet N/A set N/A N/A tgtCntDict N/A N/A ruleIndxCntDict N/A N/A fAlignDoD N/A N/A rAlignDoD N/A readPhraseSpan N/A N/A spanFile outFile tgtFile N/A N/A N/A Reads the input phrase span file for src & tgt sentences, alignment and initial phrases N/A tight_phrases_only N/A ruleDict ruleIndxCntDict tgtCntDict N/A srcWrds tgtWrds N/A sent_count 0 N/A phrLst N/A N/A Reading the span file : spanFile N/A inF N/A open spanFile r N/A line inF N/A N/A line N/A N/A line strip N/A N/A N/A line startswith LOG: SRC:  N/A N/A src N/A N/A line replace LOG: SRC:  N/A srcWrds N/A N/A src split N/A N/A N/A N/A line startswith LOG: TGT:  N/A N/A tgt N/A N/A line replace LOG: TGT:  N/A tgtWrds N/A N/A tgt split N/A N/A N/A N/A line startswith LOG: ALT:  N/A N/A align N/A N/A line replace LOG: ALT:  N/A align_pos N/A N/A align split N/A N/A m N/A N/A align_pos split - N/A N/A N/A N/A N/A alignDoD N/A N/A m N/A 0 N/A N/A m N/A 1 1 N/A N/A N/A KeyError N/A N/A N/A alignDoD N/A N/A m N/A 0 N/A N/A N/A N/A alignDoD N/A N/A m N/A 0 N/A N/A m N/A 1 1 N/A N/A N/A N/A N/A revAlignDoD N/A N/A m N/A 1 N/A N/A m N/A 0 1 N/A N/A N/A KeyError N/A N/A N/A revAlignDoD N/A N/A m N/A 1 N/A N/A N/A N/A revAlignDoD N/A N/A m N/A 1 N/A N/A m N/A 0 1 N/A N/A N/A N/A line startswith LOG: PHRASES_BEGIN: N/A N/A N/A N/A N/A N/A line startswith LOG: PHRASES_END: N/A N/A N/A xtractRules N/A rule N/A N/A ruleDict keys N/A N/A N/A compFeatureCounts rule N/A N/A N/A alignDoD clear N/A N/A N/A revAlignDoD clear N/A N/A N/A ruleDict clear N/A N/A N/A sentInitDoD clear N/A sent_count 1 N/A N/A N/A sent_count 1000 0 N/A N/A N/A Sentences processed : %6d ... sent_count N/A N/A unaligned_edge False N/A phrLst N/A N/A int x N/A x N/A N/A line split N/A N/A N/A N/A N/A alignDoD has_key N/A str N/A phrLst N/A 0 N/A N/A N/A revAlignDoD has_key N/A str N/A phrLst N/A 2 N/A N/A N/A alignDoD has_key N/A str N/A phrLst N/A 1 N/A N/A N/A revAlignDoD has_key N/A str N/A phrLst N/A 3 N/A N/A tight_phrases_only N/A N/A N/A N/A unaligned_edge True N/A sphr_len N/A N/A N/A phrLst N/A 1 N/A phrLst N/A 0 1 N/A init_phr_pair N/A N/A N/A join N/A N/A str x N/A x N/A xrange N/A phrLst N/A 0 N/A N/A phrLst N/A 1 1 N/A N/A join N/A N/A str x N/A x N/A xrange N/A phrLst N/A 2 N/A N/A phrLst N/A 3 1 N/A unaligned_edge N/A N/A N/A ruleDict N/A init_phr_pair 1.0 N/A N/A N/A N/A N/A sentInitDoD has_key sphr_len N/A N/A N/A sentInitDoD N/A sphr_len N/A N/A N/A N/A sentInitDoD N/A sphr_len N/A init_phr_pair 1 N/A N/A N/A inF close N/A N/A open outFile w oF N/A N/A rule N/A sorted N/A N/A ruleIndxCntDict iterkeys N/A N/A N/A r_indx rule_count N/A ruleIndxCntDict N/A rule N/A f_alignments N/A N/A  ##  join N/A N/A N/A fAlignDoD N/A r_indx keys N/A r_alignments N/A N/A  ##  join N/A N/A N/A rAlignDoD N/A r_indx keys N/A N/A N/A oF write N/A %s ||| %g ||| %s ||| %s
 N/A rule rule_count r_alignments f_alignments N/A N/A open tgtFile w tF N/A N/A tgt N/A sorted N/A N/A tgtCntDict iterkeys N/A N/A N/A N/A tF write N/A %s ||| %g
 N/A tgt N/A tgtCntDict N/A tgt N/A None N/A xtractRules N/A N/A N/A N/A N/A  Extract the rules for different phrase lengths (from smallest to longest)  N/A sphr_len N/A xrange max_phr_len 1 -1 N/A N/A N/A N/A sentInitDoD has_key sphr_len N/A N/A N/A check4Subphrase sphr_len N/A sphr_len 1 N/A N/A N/A sentInitDoD has_key sphr_len N/A N/A init_phr_pair N/A sentInitDoD N/A sphr_len N/A N/A N/A N/A ruleDict has_key init_phr_pair N/A N/A N/A ruleDict N/A init_phr_pair 1.0 N/A N/A N/A ruleDict N/A init_phr_pair 1.0 N/A check4Subphrase N/A N/A sphr_len N/A N/A N/A tot_src_terms X1_only tot_rules_derived N/A ppairRulesSet N/A ppairRulesDict N/A N/A phr_pair N/A N/A N/A sentInitDoD N/A sphr_len keys N/A N/A rule_cnt 0.0 N/A tot_rules_derived 0 N/A N/A N/A ppairRulesSet clear N/A N/A N/A ppairRulesDict clear N/A N/A sphr_len tot_src_terms N/A N/A tot_rules_derived 1 N/A N/A N/A ppairRulesDict has_key phr_pair N/A N/A N/A ppairRulesDict N/A phr_pair 1 N/A N/A N/A ppairRulesDict N/A phr_pair 1 N/A N/A iterateInitPhrPairs sphr_len phr_pair N/A ppairRulesSet N/A N/A sub_phr_pair N/A N/A ppairRulesSet pop N/A N/A sub_s_span sub_t_span sub_phr_pair N/A sub_phr_slen N/A len N/A N/A sub_s_span split N/A N/A sub_phr_slen tot_src_terms N/A N/A N/A N/A ppairRulesDict has_key sub_phr_pair N/A N/A N/A ppairRulesDict N/A sub_phr_pair 1 N/A N/A N/A ppairRulesDict N/A sub_phr_pair 1 N/A N/A N/A X1_only N/A N/A N/A sub_s_span find X__1 -1 N/A N/A N/A sub_s_span find X__2 -1 N/A N/A N/A N/A N/A N/A N/A N/A sub_s_span find X__1 -1 N/A N/A isRuleDecomposable sub_s_span N/A N/A N/A N/A N/A iterateInitPhrPairs sub_phr_slen sub_phr_pair N/A N/A tot_rules_derived 0 N/A N/A rule_cnt N/A 1.0 tot_rules_derived N/A rule N/A N/A ppairRulesDict keys N/A N/A weighted_cnt rule_cnt N/A weight_rules N/A N/A weighted_cnt N/A ppairRulesDict N/A rule N/A N/A N/A ruleDict has_key rule N/A N/A N/A ruleDict N/A rule weighted_cnt N/A N/A N/A ruleDict N/A rule weighted_cnt N/A isRuleDecomposable N/A N/A s_span N/A N/A N/A srcRuleTerms N/A N/A s_span split N/A N/A N/A term_indx N/A N/A srcRuleTerms index X__1 N/A N/A N/A term_indx 2 N/A N/A N/A N/A len srcRuleTerms 1 term_indx 2 N/A N/A True N/A N/A False N/A N/A N/A ValueError N/A N/A srcRuleTerms N/A N/A True N/A N/A False N/A iterateInitPhrPairs N/A N/A sphr_len N/A s_span t_span N/A N/A N/A tot_rules_derived N/A ppairRulesSet N/A sub_phr_slen N/A xrange N/A sphr_len 1 0 -1 N/A N/A N/A N/A N/A sentInitDoD has_key sub_phr_slen N/A N/A N/A sub_phr_pair N/A N/A N/A sentInitDoD N/A sub_phr_slen keys N/A N/A subSpanTuple N/A N/A sentInitDoD N/A sub_phr_slen N/A sub_phr_pair N/A src_side_compatible N/A checkRuleCompatibility s_span N/A sub_phr_pair N/A 0 N/A tgt_side_compatible N/A checkRuleCompatibility t_span N/A sub_phr_pair N/A 1 N/A N/A src_side_compatible tgt_side_compatible N/A N/A N/A sub_s_span sub_t_span sub_phr_pair N/A rule N/A checkConstraints s_span t_span sub_s_span sub_t_span N/A N/A rule None N/A N/A N/A N/A ppairRulesSet add rule N/A tot_rules_derived 1 N/A checkRuleCompatibility N/A N/A rule sub_rule N/A N/A N/A Checks if the sub phrase is compatible with the bigger rule (for both src & tgt rules) N/A N/A N/A N/A rule startswith N/A sub_rule N/A N/A rule endswith N/A sub_rule N/A N/A N/A rule find N/A N/A sub_rule -1 N/A N/A True N/A False N/A checkConstraints N/A N/A src tgt sub_src sub_tgt N/A N/A N/A  Checks if the rules satisfy the filtering constraints (without these the grammar would explode)  N/A X1_indx N/A N/A src find X__1 N/A N/A X1_indx -1 N/A N/A N/A N/A N/A N/A len N/A N/A src split N/A len N/A N/A sub_src split 1 tot_src_terms N/A N/A None N/A adj_X1_right N/A sub_src  X__1 N/A adj_X1_left N/A X__1  sub_src N/A N/A N/A N/A src startswith adj_X1_right N/A N/A N/A src find N/A adj_X1_right -1 N/A N/A src endswith adj_X1_left N/A N/A N/A src find N/A adj_X1_left -1 N/A N/A None N/A N/A N/A N/A src startswith N/A sub_src N/A N/A N/A src find N/A N/A sub_src 0 X1_indx -1 N/A N/A src N/A N/A src replace X__1 X__2 1 N/A tgt N/A N/A tgt replace X__1 X__2 1 N/A rep_str X__1 N/A N/A rep_str X__2 N/A N/A rep_str X__1 N/A s_side N/A replaceItem src sub_src rep_str N/A t_side N/A replaceItem tgt sub_tgt rep_str N/A tgtTermLst N/A N/A t_side split N/A aligned_terminal False N/A pos N/A N/A s_side split N/A N/A N/A N/A N/A alignDoD has_key pos N/A N/A N/A tgt_align_pos N/A N/A N/A alignDoD N/A pos keys N/A N/A N/A N/A N/A N/A tgtTermLst index tgt_align_pos N/A aligned_terminal True N/A N/A N/A N/A ValueError N/A N/A N/A aligned_terminal N/A N/A N/A s_side t_side N/A None N/A replaceItem N/A N/A full_str p_match rep_str N/A N/A N/A N/A N/A len N/A N/A p_match split 1 N/A N/A N/A N/A full_str replace p_match rep_str 1 N/A N/A tmpLst N/A N/A tok N/A N/A full_str split N/A N/A N/A tok p_match N/A N/A N/A N/A tmpLst append rep_str N/A N/A N/A N/A tmpLst append tok N/A N/A N/A join tmpLst N/A compFeatureCounts N/A N/A rule N/A N/A N/A Convert to lexical rule and find the alignment for the entries in the rule. Also compute feature counts P(s|t), P(t|s), P_w(s|t) and P_w(t|s) N/A srcWrds tgtWrds N/A fAlignDoD rAlignDoD N/A srcLexLst N/A N/A tgtLexLst N/A N/A alignLst N/A N/A sPosLst N/A N/A N/A rule N/A 0 split N/A tPosLst N/A N/A N/A rule N/A 1 split N/A item_indx 0 N/A s_tok sPosLst N/A N/A N/A N/A s_tok startswith X__ N/A N/A N/A N/A srcLexLst append s_tok N/A N/A N/A N/A srcLexLst append N/A srcWrds N/A N/A int s_tok N/A alignment N/A getFwrdAlignment item_indx s_tok tPosLst N/A N/A N/A alignLst append alignment N/A item_indx 1 N/A fAlignment N/A N/A join alignLst N/A N/A alignLst N/A N/A item_indx 0 N/A t_tok tPosLst N/A N/A N/A N/A t_tok startswith X__ N/A N/A N/A N/A tgtLexLst append t_tok N/A N/A N/A N/A tgtLexLst append N/A tgtWrds N/A N/A int t_tok N/A alignment N/A getRvrsAlignment item_indx t_tok sPosLst N/A N/A N/A alignLst append alignment N/A item_indx 1 N/A rAlignment N/A N/A join alignLst N/A curr_rindx N/A updateRuleCount N/A N/A join srcLexLst N/A N/A join tgtLexLst rule N/A f_align_indx N/A getAlignIndex fAlignment N/A r_align_indx N/A getAlignIndex rAlignment N/A N/A N/A N/A fAlignDoD has_key curr_rindx N/A N/A N/A fAlignDoD N/A curr_rindx N/A N/A N/A rAlignDoD N/A curr_rindx N/A N/A N/A N/A N/A N/A fAlignDoD N/A curr_rindx has_key f_align_indx N/A N/A N/A N/A fAlignDoD N/A curr_rindx N/A f_align_indx 1 N/A N/A N/A N/A N/A rAlignDoD N/A curr_rindx has_key r_align_indx N/A N/A N/A N/A rAlignDoD N/A curr_rindx N/A r_align_indx 1 N/A updateRuleCount N/A N/A mc_src mc_tgt rule N/A N/A N/A  Updates rule and target counts  N/A rule_indx ruleDict ruleIndxCntDict tgtCntDict N/A N/A N/A N/A tgtCntDict has_key mc_tgt N/A N/A N/A tgtCntDict N/A mc_tgt 0 N/A N/A tgtCntDict N/A mc_tgt N/A ruleDict N/A rule N/A mc_key N/A N/A mc_src  |||  mc_tgt N/A N/A N/A ruleIndxCntDict has_key mc_key N/A N/A N/A curr_rindx curr_cnt N/A ruleIndxCntDict N/A mc_key N/A N/A ruleIndxCntDict N/A mc_key N/A curr_rindx N/A curr_cnt N/A ruleDict N/A rule N/A N/A N/A ruleIndxCntDict N/A mc_key N/A rule_indx N/A ruleDict N/A rule N/A curr_rindx rule_indx N/A rule_indx 1 N/A curr_rindx N/A getAlignIndex N/A N/A align_str N/A N/A N/A tmpLst N/A N/A align_str split N/A N/A N/A tmpLst sort N/A aindx N/A N/A join tmpLst N/A N/A N/A aindx replace - N/A getFwrdAlignment N/A N/A item_indx s_pos tPosLst N/A N/A N/A Computes the alignment and lexical weights in forward direction N/A alignLst N/A N/A N/A N/A alignDoD has_key s_pos N/A N/A alignKeyLst N/A N/A N/A alignDoD N/A s_pos keys N/A N/A N/A alignKeyLst sort N/A t_pos alignKeyLst N/A N/A N/A N/A alignment N/A N/A N/A str item_indx - N/A str N/A N/A tPosLst index t_pos N/A N/A N/A alignLst append alignment N/A N/A N/A ValueError N/A N/A N/A N/A N/A N/A alignLst append N/A N/A str item_indx -Z N/A N/A N/A join alignLst N/A getRvrsAlignment N/A N/A item_indx t_pos sPosLst N/A N/A N/A Computes the alignment and lexical weights in reverse direction N/A alignLst N/A N/A N/A N/A revAlignDoD has_key t_pos N/A N/A alignKeyLst N/A N/A N/A revAlignDoD N/A t_pos keys N/A N/A N/A alignKeyLst sort N/A s_pos alignKeyLst N/A N/A N/A N/A alignment N/A N/A N/A str N/A N/A sPosLst index s_pos - N/A str item_indx N/A N/A N/A alignLst append alignment N/A N/A N/A ValueError N/A N/A N/A N/A N/A N/A alignLst append N/A Z- N/A str item_indx N/A N/A N/A join alignLst N/A main N/A N/A N/A N/A N/A tight_phrases_only N/A tot_src_terms N/A X1_only N/A N/A N/A N/A len N/A sys argv 4 N/A N/A len N/A sys argv 6 N/A N/A N/A Usage: python %s <file_index> <dataDir> <outDir> [Total_terms on Fr side (def 7)] [True/False] [True/False] N/A N/A sys argv N/A 0 N/A Exiting!!
 N/A N/A N/A sys exit N/A file_indx N/A N/A sys argv N/A 1 N/A dDir N/A N/A sys argv N/A 2 N/A oDir N/A N/A sys argv N/A 3 N/A N/A N/A len N/A sys argv 4 N/A N/A tot_src_terms N/A int N/A N/A sys argv N/A 4 N/A N/A N/A N/A len N/A sys argv 6 N/A N/A N/A sys argv N/A 5 True N/A N/A N/A sys argv N/A 5 False N/A N/A Last argument should be a boolean True/False indicating one/two non-terminal case N/A N/A N/A sys exit 1 N/A N/A N/A N/A len N/A sys argv 6 N/A N/A N/A sys argv N/A 5 True N/A N/A X1_only True N/A N/A N/A N/A len N/A sys argv 7 N/A N/A N/A sys argv N/A 6 False N/A N/A tight_phrases_only False N/A Using the French side total terms to be : tot_src_terms N/A Enforcing tight phrase-pairs constraint : tight_phrases_only N/A N/A N/A N/A dDir endswith / N/A N/A dDir / N/A N/A N/A N/A oDir endswith / N/A N/A oDir / N/A spanFile N/A N/A dDir file_indx .outspan N/A outFile N/A N/A oDir file_indx .out N/A tgtFile N/A N/A N/A oDir tgt. file_indx .out N/A N/A readPhraseSpan spanFile outFile tgtFile N/A N/A N/A __name__ __main__ N/A N/A N/A main