コード例 #1
0
                    start = word_id.find(token)

                    if (start == -1):

                        final_hindi_tok = find_hinglish_to_hindi(
                            token, h2h_list_returned)

                        if (final_hindi_tok != 0):

                            final_english_tok = find_hindi_to_english(
                                final_hindi_tok, h2e_list_returned)

                            if (final_english_tok != 0):

                                final_english_tok = spell_correct(
                                    final_english_tok)
                                polarity = get_senti(final_english_tok)

                                if (polarity >= .2):
                                    pos_score = compute_pos_score(pos_score)

                                elif (polarity > -.2 and polarity < .2):
                                    neu_score = compute_neu_score(neu_score)

                                else:
                                    neg_score = compute_neg_score(neg_score)

                            else:

                                trans_english_tok = goog_trans_hindi_to_english(
                                    final_hindi_tok)
コード例 #2
0
                    if (find_pos == -1 and find_neg == -1 and find_neu == -1):

                        start = word_id.find(token)

                        if (start == -1):
                            continue

                        else:

                            end = start + len(token)
                            check = word_id[end + 1]

                            if (check == "e"):

                                token = spell_correct(token)
                                polarity = get_senti(token)
                                theory = get_sub(token)

                                sub_compute.compute_score(
                                    polarity, pos_score, neu_score, neg_score,
                                    sub_score, theory)

                            elif (check == 'h'):

                                hinglish_2_hindi_tok = hinglish_2_hindi(
                                    token, h2h_list)

                                if (hinglish_2_hindi_tok != 0):

                                    final_english_tok = hindi_2_english(