Exemplo n.º 1
0
    def __alter_repeat_for_wish(fixed_df):
        wish_idx = Nlp_util.get_idx_list_of_word("wish", fixed_df["base_form"])[0]
        row_of_subj = Nlp_util.get_wordsDF_of_wordlist_after_idx(fixed_df, Nlp_util.pos_NOUNs+Nlp_util.pos_PRPs, wish_idx, column_name="pos").iloc[0]
        row_of_verb = Nlp_util.get_wordsDF_of_wordlist_after_idx(fixed_df, Nlp_util.pos_VERBs, row_of_subj.name, column_name="pos").iloc[0]
        subj = row_of_subj.word
        verb = row_of_verb.word
        after_verb = WordFormatter.Series2Str(fixed_df.loc[row_of_verb.name+1:, "word"])
        objective_subj = Nlp_util.convert_nominative_noun_to_objective(subj)
        if subj == "you":
            repeat_list = [
                ["you really want to "+verb+" "+after_verb],
                ["so you seriously hope to "+verb+" "+after_verb],
                ["so you are dying to "+verb+" "+after_verb]
            ]
        else:
            repeat_list = [
                ["you really want "+objective_subj+" to "+verb+" "+after_verb],
                ["you really wanna have "+objective_subj+" "+verb+" "+after_verb],
                ["you really wanna make "+objective_subj+" "+verb+" "+after_verb]
            ]

        cmp_list = [
            ["but sounds you feel bit too much to expect that now..?"],
            ["and sounds you feel like its impossible..?"],
            ["and seems like you dont think it never happen😓"]
        ]
        random_idx_for_repeat_list = randint(0, len(repeat_list) - 1)
        random_idx_for_cmp_list = randint(0, len(cmp_list) - 1)

        return repeat_list[random_idx_for_repeat_list]+cmp_list[random_idx_for_cmp_list]
Exemplo n.º 2
0
    def __alter_repeat_for_need_sent(fixed_df):
        idx_of_need = Nlp_util.get_idx_list_of_word("need",
                                                    fixed_df["base_form"])[0]

        row_of_first_noun = \
            Nlp_util.get_wordsDF_of_wordlist_after_idx(fixed_df, Nlp_util.pos_NOUNs + Nlp_util.pos_PRPs,
                                                       idx_of_need,
                                                       column_name="pos").iloc[0]
        if fixed_df.loc[row_of_first_noun.name - 1,
                        "pos"] in Nlp_util.pos_ADJECTIVEs + ["PRP$", "DT"]:
            noun = WordFormatter.Series2Str(
                fixed_df.loc[row_of_first_noun.name - 1:row_of_first_noun.name,
                             "word"])
        else:
            noun = fixed_df.loc[row_of_first_noun.name, "word"]

        noun_nominative = Nlp_util.convert_objective_noun_to_nominative(noun)

        options = [[
            "so " + noun_nominative + " is very important thing for you..",
            "and sounds its kinda hard to get it now right😢"
        ],
                   [
                       "so its like its not easy to get " + noun +
                       " now but you really want..",
                       "and it can frustrate you😞"
                   ],
                   [
                       "sounds you really want " + noun + "..",
                       "might be tough time for you to seek for it now😓"
                   ]]

        random_idx_for_options = randint(0, len(options) - 1)

        return options[random_idx_for_options]