def find_max_match(self, options_list, el_value):
        el_value_list = el_value.split()
        # Remove all words of length = 1 such as hyphens.
        el_value_list = filter(lambda x: len(x) > 1, el_value_list)
        # Initialise max_len as 0 and matchec_option = None.
        max_len = 0
        matched_option = None

        for option in options_list:
            text = option.text
            text_list = text.split()
            # Remove all words of length = 1 such as hyphens.
            text_list = filter(lambda x: len(x) > 1, text_list)
            # Find intersection of el_value_list and text_list
            matched_list = list(set(el_value_list).intersection(text_list))
            # matched_len is number of matching words for the current option.
            matched_len = len(matched_list)
            # Save the maximum matched option in matched_option.
            if matched_len > max_len:
                matched_option = option
                max_len = matched_len

        # Return the maximum matched option.
        return matched_option

    # -------------------------------------------------------------------------
Finds the Longest Word Trimmed Match for selecting text in options field.
dataset/ETHPy150Open sahana/eden/modules/tests/web2unittest.py/SeleniumUnitTest.find_max_match