_ALL_TEXT =[
    "meta__upper__FittedShirt",
    "meta__upper__Shirt",
    "meta__upper__None",
    "meta__wb__StraightWB",
    "meta__wb__FittedWB",
    "meta__wb__None",
    "meta__bottom__SkirtCircle",
    "meta__bottom__AsymmSkirtCircle",
    "meta__bottom__GodetSkirt",
    "meta__bottom__Pants",
    "meta__bottom__Skirt2",
    "meta__bottom__SkirtManyPanels",
    "meta__bottom__PencilSkirt",
    "meta__bottom__SkirtLevels",
    "meta__bottom__None",
    "meta__connected__True",
    "meta__connected__False",
    "waistband__waist__fitted",
    "waistband__waist__slightly-loose",
    "waistband__waist__loose",
    "waistband__width__narrow",
    "waistband__width__medium",
    "waistband__width__wide",
    "fitted_shirt__strapless__True",
    "fitted_shirt__strapless__False",
    "shirt__length__super-cropped",
    "shirt__length__regular",
    "shirt__length__long",
    "shirt__width__normal",
    "shirt__width__relaxed",
    "shirt__flare__tight",
    "shirt__flare__straight",
    "shirt__flare__flared",
    "shirt__flare__very-flared",
    "collar__f_collar__CircleNeckHalf",
    "collar__f_collar__CurvyNeckHalf",
    "collar__f_collar__VNeckHalf",
    "collar__f_collar__SquareNeckHalf",
    "collar__f_collar__TrapezoidNeckHalf",
    "collar__f_collar__CircleArcNeckHalf",
    "collar__f_collar__Bezier2NeckHalf",
    "collar__b_collar__CircleNeckHalf",
    "collar__b_collar__CurvyNeckHalf",
    "collar__b_collar__VNeckHalf",
    "collar__b_collar__SquareNeckHalf",
    "collar__b_collar__TrapezoidNeckHalf",
    "collar__b_collar__CircleArcNeckHalf",
    "collar__b_collar__Bezier2NeckHalf",
    "collar__width__very-narrow",
    "collar__width__medium",
    "collar__width__wide",
    "collar__fc_depth__shallow",
    "collar__fc_depth__medium",
    "collar__fc_depth__deep",
    "collar__bc_depth__shallow",
    "collar__bc_depth__medium",
    "collar__bc_depth__deep",
    "collar__fc_angle__acute",
    "collar__fc_angle__standard",
    "collar__fc_angle__obtuse",
    "collar__bc_angle__acute",
    "collar__bc_angle__standard",
    "collar__bc_angle__obtuse",
    "collar__f_bezier_x__left",
    "collar__f_bezier_x__center",
    "collar__f_bezier_x__right",
    "collar__f_bezier_y__top",
    "collar__f_bezier_y__center",
    "collar__f_bezier_y__bottom",
    "collar__b_bezier_x__left",
    "collar__b_bezier_x__center",
    "collar__b_bezier_x__right",
    "collar__b_bezier_y__top",
    "collar__b_bezier_y__center",
    "collar__b_bezier_y__bottom",
    "collar__f_flip_curve__True",
    "collar__f_flip_curve__False",
    "collar__b_flip_curve__True",
    "collar__b_flip_curve__False",
    "collar__component__style__Turtle",
    "collar__component__style__SimpleLapel",
    "collar__component__style__Hood2Panels",
    "collar__component__style__None",
    "collar__component__depth__shallow",
    "collar__component__depth__medium",
    "collar__component__depth__deep",
    "collar__component__lapel_standing__True",
    "collar__component__lapel_standing__False",
    "collar__component__hood_depth__shallow",
    "collar__component__hood_depth__medium",
    "collar__component__hood_depth__deep",
    "collar__component__hood_length__short",
    "collar__component__hood_length__medium",
    "collar__component__hood_length__long",
    "sleeve__sleeveless__True",
    "sleeve__sleeveless__False",
    "sleeve__armhole_shape__ArmholeSquare",
    "sleeve__armhole_shape__ArmholeAngle",
    "sleeve__armhole_shape__ArmholeCurve",
    "sleeve__length__short",
    "sleeve__length__half",
    "sleeve__length__three-quarter",
    "sleeve__length__long",
    "sleeve__length__full",
    "sleeve__connecting_width__narrow",
    "sleeve__connecting_width__medium",
    "sleeve__connecting_width__loose",
    "sleeve__connecting_width__very-loose",
    "sleeve__end_width__closing",
    "sleeve__end_width__straight",
    "sleeve__end_width__opening",
    "sleeve__sleeve_angle__small",
    "sleeve__sleeve_angle__medium",
    "sleeve__sleeve_angle__large",
    "sleeve__opening_dir_mix__negative-twist",
    "sleeve__opening_dir_mix__standard",
    "sleeve__opening_dir_mix__positive-twist",
    "sleeve__standing_shoulder__True",
    "sleeve__standing_shoulder__False",
    "sleeve__standing_shoulder_len__short",
    "sleeve__standing_shoulder_len__medium",
    "sleeve__standing_shoulder_len__long",
    "sleeve__connect_ruffle__none",
    "sleeve__connect_ruffle__some",
    "sleeve__connect_ruffle__obvious",
    "sleeve__smoothing_coeff__very-smooth",
    "sleeve__smoothing_coeff__moderate",
    "sleeve__smoothing_coeff__less-smooth",
    "sleeve__cuff__type__CuffBand",
    "sleeve__cuff__type__CuffSkirt",
    "sleeve__cuff__type__CuffBandSkirt",
    "sleeve__cuff__type__None",
    "sleeve__cuff__top_ruffle__straight",
    "sleeve__cuff__top_ruffle__tapered",
    "sleeve__cuff__top_ruffle__very_tapered",
    "sleeve__cuff__cuff_len__short",
    "sleeve__cuff__cuff_len__medium",
    "sleeve__cuff__cuff_len__long",
    "sleeve__cuff__skirt_fraction__small",
    "sleeve__cuff__skirt_fraction__medium",
    "sleeve__cuff__skirt_fraction__large",
    "sleeve__cuff__skirt_flare__slight",
    "sleeve__cuff__skirt_flare__moderate",
    "sleeve__cuff__skirt_flare__significant",
    "sleeve__cuff__skirt_ruffle__none",
    "sleeve__cuff__skirt_ruffle__some",
    "left__enable_asym__True",
    "left__enable_asym__False",
    "left__fitted_shirt__strapless__True",
    "left__fitted_shirt__strapless__False",
    "left__shirt__width__normal",
    "left__shirt__width__relaxed",
    "left__shirt__flare__tight",
    "left__shirt__flare__straight",
    "left__shirt__flare__flared",
    "left__shirt__flare__very-flared",
    "left__collar__f_collar__CircleNeckHalf",
    "left__collar__f_collar__CurvyNeckHalf",
    "left__collar__f_collar__VNeckHalf",
    "left__collar__f_collar__SquareNeckHalf",
    "left__collar__f_collar__TrapezoidNeckHalf",
    "left__collar__f_collar__CircleArcNeckHalf",
    "left__collar__f_collar__Bezier2NeckHalf",
    "left__collar__b_collar__CircleNeckHalf",
    "left__collar__b_collar__CurvyNeckHalf",
    "left__collar__b_collar__VNeckHalf",
    "left__collar__b_collar__SquareNeckHalf",
    "left__collar__b_collar__TrapezoidNeckHalf",
    "left__collar__b_collar__CircleArcNeckHalf",
    "left__collar__b_collar__Bezier2NeckHalf",
    "left__collar__width__narrow",
    "left__collar__width__medium",
    "left__collar__width__wide",
    "left__collar__fc_angle__acute",
    "left__collar__fc_angle__standard",
    "left__collar__fc_angle__obtuse",
    "left__collar__bc_angle__acute",
    "left__collar__bc_angle__standard",
    "left__collar__bc_angle__obtuse",
    "left__collar__f_bezier_x__left",
    "left__collar__f_bezier_x__center",
    "left__collar__f_bezier_x__right",
    "left__collar__f_bezier_y__top",
    "left__collar__f_bezier_y__center",
    "left__collar__f_bezier_y__bottom",
    "left__collar__b_bezier_x__left",
    "left__collar__b_bezier_x__center",
    "left__collar__b_bezier_x__right",
    "left__collar__b_bezier_y__top",
    "left__collar__b_bezier_y__center",
    "left__collar__b_bezier_y__bottom",
    "left__collar__f_flip_curve__True",
    "left__collar__f_flip_curve__False",
    "left__collar__b_flip_curve__True",
    "left__collar__b_flip_curve__False",
    "left__sleeve__sleeveless__True",
    "left__sleeve__sleeveless__False",
    "left__sleeve__armhole_shape__ArmholeSquare",
    "left__sleeve__armhole_shape__ArmholeAngle",
    "left__sleeve__armhole_shape__ArmholeCurve",
    "left__sleeve__length__short",
    "left__sleeve__length__half",
    "left__sleeve__length__three-quarter",
    "left__sleeve__length__long",
    "left__sleeve__length__full",
    "left__sleeve__connecting_width__narrow",
    "left__sleeve__connecting_width__medium",
    "left__sleeve__connecting_width__loose",
    "left__sleeve__connecting_width__very-loose",
    "left__sleeve__end_width__closing",
    "left__sleeve__end_width__straight",
    "left__sleeve__end_width__opening",
    "left__sleeve__sleeve_angle__small",
    "left__sleeve__sleeve_angle__medium",
    "left__sleeve__sleeve_angle__large",
    "left__sleeve__opening_dir_mix__negative-twist",
    "left__sleeve__opening_dir_mix__standard",
    "left__sleeve__opening_dir_mix__positive-twist",
    "left__sleeve__standing_shoulder__True",
    "left__sleeve__standing_shoulder__False",
    "left__sleeve__standing_shoulder_len__short",
    "left__sleeve__standing_shoulder_len__medium",
    "left__sleeve__standing_shoulder_len__long",
    "left__sleeve__connect_ruffle__none",
    "left__sleeve__connect_ruffle__some",
    "left__sleeve__connect_ruffle__obvious",
    "left__sleeve__smoothing_coeff__very-smooth",
    "left__sleeve__smoothing_coeff__moderate",
    "left__sleeve__smoothing_coeff__less-smooth",
    "left__sleeve__cuff__type__CuffBand",
    "left__sleeve__cuff__type__CuffSkirt",
    "left__sleeve__cuff__type__CuffBandSkirt",
    "left__sleeve__cuff__type__None",
    "left__sleeve__cuff__top_ruffle__straight",
    "left__sleeve__cuff__top_ruffle__tapered",
    "left__sleeve__cuff__top_ruffle__very_tapered",
    "left__sleeve__cuff__cuff_len__short",
    "left__sleeve__cuff__cuff_len__medium",
    "left__sleeve__cuff__cuff_len__long",
    "left__sleeve__cuff__skirt_fraction__small",
    "left__sleeve__cuff__skirt_fraction__medium",
    "left__sleeve__cuff__skirt_fraction__large",
    "left__sleeve__cuff__skirt_flare__slight",
    "left__sleeve__cuff__skirt_flare__moderate",
    "left__sleeve__cuff__skirt_flare__significant",
    "left__sleeve__cuff__skirt_ruffle__none",
    "left__sleeve__cuff__skirt_ruffle__some",
    "skirt__length__micro",
    "skirt__length__mini",
    "skirt__length__above-knee",
    "skirt__length__knee-length",
    "skirt__length__midi",
    "skirt__length__floor-length",
    "skirt__rise__low",
    "skirt__rise__mid",
    "skirt__rise__high",
    "skirt__ruffle__none",
    "skirt__ruffle__moderate",
    "skirt__ruffle__rich",
    "skirt__bottom_cut__none",
    "skirt__bottom_cut__shallow",
    "skirt__bottom_cut__deep",
    "skirt__flare__none",
    "skirt__flare__small",
    "skirt__flare__medium",
    "skirt__flare__large",
    "flare-skirt__length__micro",
    "flare-skirt__length__mini",
    "flare-skirt__length__above-knee",
    "flare-skirt__length__knee-length",
    "flare-skirt__length__midi",
    "flare-skirt__length__floor-length",
    "flare-skirt__rise__low",
    "flare-skirt__rise__mid",
    "flare-skirt__rise__high",
    "flare-skirt__suns__slight",
    "flare-skirt__suns__moderate",
    "flare-skirt__suns__significant",
    "flare-skirt__skirt-many-panels__n_panels__few",
    "flare-skirt__skirt-many-panels__n_panels__medium",
    "flare-skirt__skirt-many-panels__n_panels__many",
    "flare-skirt__skirt-many-panels__panel_curve__inward",
    "flare-skirt__skirt-many-panels__panel_curve__straight",
    "flare-skirt__skirt-many-panels__panel_curve__outward",
    "flare-skirt__asymm__front_length__highly-asymmetric",
    "flare-skirt__asymm__front_length__strongly-asymmetric",
    "flare-skirt__asymm__front_length__moderately-asymmetric",
    "flare-skirt__asymm__front_length__slightly-asymmetric",
    "flare-skirt__asymm__front_length__symmetric",
    "flare-skirt__cut__add__True",
    "flare-skirt__cut__add__False",
    "flare-skirt__cut__depth__shallow",
    "flare-skirt__cut__depth__medium",
    "flare-skirt__cut__depth__deep",
    "flare-skirt__cut__width__narrow",
    "flare-skirt__cut__width__medium",
    "flare-skirt__cut__width__wide",
    "flare-skirt__cut__place__back_left",
    "flare-skirt__cut__place__back_center",
    "flare-skirt__cut__place__back_right",
    "flare-skirt__cut__place__front_left",
    "flare-skirt__cut__place__front_center",
    "flare-skirt__cut__place__front_right",
    "godet-skirt__base__Skirt2",
    "godet-skirt__base__PencilSkirt",
    "godet-skirt__insert_w__narrow",
    "godet-skirt__insert_w__medium",
    "godet-skirt__insert_w__wide",
    "godet-skirt__insert_depth__shallow",
    "godet-skirt__insert_depth__medium",
    "godet-skirt__insert_depth__deep",
    "godet-skirt__num_inserts__4",
    "godet-skirt__num_inserts__6",
    "godet-skirt__num_inserts__8",
    "godet-skirt__num_inserts__10",
    "godet-skirt__num_inserts__12",
    "godet-skirt__cuts_distance__close",
    "godet-skirt__cuts_distance__medium",
    "godet-skirt__cuts_distance__far",
    "pencil-skirt__length__micro",
    "pencil-skirt__length__mini",
    "pencil-skirt__length__above-knee",
    "pencil-skirt__length__knee-length",
    "pencil-skirt__length__midi",
    "pencil-skirt__length__floor-length",
    "pencil-skirt__rise__low",
    "pencil-skirt__rise__mid",
    "pencil-skirt__rise__high",
    "pencil-skirt__flare__tight",
    "pencil-skirt__flare__straight",
    "pencil-skirt__flare__slight-flare",
    "pencil-skirt__low_angle__inward",
    "pencil-skirt__low_angle__straight",
    "pencil-skirt__low_angle__outward",
    "pencil-skirt__front_slit__none",
    "pencil-skirt__front_slit__shallow",
    "pencil-skirt__front_slit__deep",
    "pencil-skirt__back_slit__none",
    "pencil-skirt__back_slit__shallow",
    "pencil-skirt__back_slit__deep",
    "pencil-skirt__left_slit__none",
    "pencil-skirt__left_slit__shallow",
    "pencil-skirt__left_slit__deep",
    "pencil-skirt__right_slit__none",
    "pencil-skirt__right_slit__shallow",
    "pencil-skirt__right_slit__deep",
    "pencil-skirt__style_side_cut__Sun",
    "pencil-skirt__style_side_cut__SIGGRAPH_logo",
    "pencil-skirt__style_side_cut__None",
    "levels-skirt__base__Skirt2",
    "levels-skirt__base__PencilSkirt",
    "levels-skirt__base__SkirtCircle",
    "levels-skirt__base__AsymmSkirtCircle",
    "levels-skirt__level__Skirt2",
    "levels-skirt__level__SkirtCircle",
    "levels-skirt__level__AsymmSkirtCircle",
    "levels-skirt__num_levels__1",
    "levels-skirt__num_levels__2",
    "levels-skirt__num_levels__3",
    "levels-skirt__num_levels__4",
    "levels-skirt__num_levels__5",
    "levels-skirt__level_ruffle__none",
    "levels-skirt__level_ruffle__moderate",
    "levels-skirt__level_ruffle__rich",
    "levels-skirt__length__micro",
    "levels-skirt__length__mini",
    "levels-skirt__length__above-knee",
    "levels-skirt__length__knee-length",
    "levels-skirt__length__midi",
    "levels-skirt__length__floor-length",
    "levels-skirt__rise__low",
    "levels-skirt__rise__mid",
    "levels-skirt__rise__high",
    "levels-skirt__base_length_frac__short",
    "levels-skirt__base_length_frac__medium",
    "levels-skirt__base_length_frac__long",
    "pants__length__micro",
    "pants__length__short",
    "pants__length__knee-length",
    "pants__length__capri",
    "pants__length__ankle-length",
    "pants__length__full-length",
    "pants__width__fitted",
    "pants__width__normal",
    "pants__width__loose",
    "pants__flare__tapering",
    "pants__flare__straight",
    "pants__flare__slight-flare",
    "pants__rise__low",
    "pants__rise__mid",
    "pants__rise__high",
    "pants__cuff__type__CuffBand",
    "pants__cuff__type__CuffSkirt",
    "pants__cuff__type__CuffBandSkirt",
    "pants__cuff__type__None",
    "pants__cuff__top_ruffle__straight",
    "pants__cuff__top_ruffle__tapered",
    "pants__cuff__top_ruffle__very_tapered",
    "pants__cuff__cuff_len__short",
    "pants__cuff__cuff_len__medium",
    "pants__cuff__cuff_len__long",
    "pants__cuff__skirt_fraction__small",
    "pants__cuff__skirt_fraction__medium",
    "pants__cuff__skirt_fraction__large",
    "pants__cuff__skirt_flare__slight",
    "pants__cuff__skirt_flare__moderate",
    "pants__cuff__skirt_flare__significant",
    "pants__cuff__skirt_ruffle__none",
    "pants__cuff__skirt_ruffle__some"
]

fail_text_list = []

def list_in_text( my_list, start_string, connect_tag='__'):
    ''' Search the list for all items starting with start-string and only the first two items separated by __,
    Then use the text to correspond to the startstring. The first two items are used to determine whether they are in the list of predictions
    Args:_ALL_TEXT
        my_list (list): The list to be searched
        start_string(string): A string at the beginning
        connect_tag (string): The symbol that Chinese the book is connected in the my_list

    '''
    global fail_text_list
    temp_flag=True
    meta_item_list = [
        connect_tag.join(item.split(connect_tag)[:start_string.count(connect_tag) + 2])  # Split and keep the next field starting with the start_string
        for item in my_list
        if item.startswith(start_string) and item.count(connect_tag) >= start_string.count(connect_tag) + 1
    ]
    meta_item_text = [
        connect_tag.join(item.split(connect_tag)[:start_string.count(connect_tag) + 2])  # Split and keep the next field starting with the start_string
        for item in _ALL_TEXT
        if item.startswith(start_string) and item.count(connect_tag) >= start_string.count(connect_tag) + 1
    ]

    meta_item_list_set=set(meta_item_list)
    meta_item_text_set=set(meta_item_text)
    start_string_fail_list=list(meta_item_text_set-meta_item_list_set)
    if len(start_string_fail_list)>0:
        fail_text_list.extend(start_string_fail_list)
        temp_flag=False
        print(f'mylist{start_string}Words that are missing from the opening word：{start_string_fail_list}')
    return temp_flag
def bool2condition(my_list,connect_tag='__'):
    global fail_text_list
    fail_text_list = []
    bool_flag = True
    meta_list=[item.split(connect_tag)[-1] for item in my_list if item.startswith("meta")]
    # Determine whether meta_upper wb bottom is generated
    if list_in_text(my_list,'meta')==False:
        bool_flag = False
    left_bool="False"
    left_flag = [s for s in my_list if s.startswith("left__enable_asym")]
    if meta_list[0]!="None":
        if len(left_flag)==0:
            print("left__enable_asym")
            fail_text_list.append("left__enable_asym")
            bool_flag = False
        else:
            left_bool=left_flag[0].split(connect_tag)[-1]
    left_fittedshirt_strapless_bool=True
    left_fittedshirt_strapless_flag=[s for s in my_list if s.startswith("left__fitted_shirt__strapless")]
    if meta_list[0] =='FittedShirt' and left_bool=='True' :
        if len(left_fittedshirt_strapless_flag)==0 :
            print("left__fitted_shirt__strapless")
            fail_text_list.append("left__fitted_shirt__strapless")
            bool_flag = False
            return bool_flag, sorted(list(set(fail_text_list)))
        if len(left_fittedshirt_strapless_flag) > 0:
            if left_fittedshirt_strapless_flag[0].split(connect_tag)[-1] == 'False':
                left_fittedshirt_strapless_bool = False
    for meta_item in meta_list:
        if meta_item =='FittedShirt':
            if list_in_text(my_list,'fitted_shirt')==False:
                bool_flag = False
        if meta_item =='Shirt':
            if list_in_text(my_list,'shirt')==False:
                bool_flag=False
            if left_bool == 'True':
                if list_in_text(my_list, 'left__shirt') == False:
                    bool_flag = False
        if meta_item=="StraightWB" or meta_item=="FittedWB":
            if list_in_text(my_list,'waistband')==False:
                bool_flag=False
        if meta_item =="SkirtCircle" or meta_item =="SkirtManyPanels"  or meta_item=='AsymmSkirtCircle':
            if list_in_text(my_list,"flare-skirt")==False:
                bool_flag=False
            if meta_item=='SkirtCircle':
                if list_in_text(my_list,'flare-skirt__cut')==False:
                    bool_flag=False
            if meta_item=='AsymmSkirtCircle':
                if list_in_text(my_list,"flare-skirt__asymm__front_length")==False:
                    bool_flag=False
                if list_in_text(my_list,'flare-skirt__cut')==False:
                    bool_flag=False
            if meta_item=='SkirtManyPanels':
                if list_in_text(my_list,"flare-skirt__skirt-many-panels")==False:
                    bool_flag=False
        if meta_item=='GodetSkirt':
            if list_in_text(my_list,"godet-skirt")==False:
                bool_flag=False
            godet_base_item = [item.split(connect_tag)[-1] for item in my_list if item.startswith("godet-skirt__base")]
            if len(godet_base_item) == 0:
                bool_flag = False
                print("godet-skirt__base")
                fail_text_list.append("godet-skirt__base")
                return bool_flag, sorted(list(set(fail_text_list)))
            else:
                godet_base_item = godet_base_item[0]
            if godet_base_item == "Skirt2":
                if list_in_text(my_list, "skirt") == False:
                    bool_flag = False
            if godet_base_item == "PencilSkirt":
                if list_in_text(my_list, "pencil-skirt") == False:
                    bool_flag = False
        if meta_item=='SkirtLevels':
            if list_in_text(my_list,"levels-skirt")==False:
                bool_flag=False
            base_item = [item.split(connect_tag)[-1] for item in my_list if item.startswith("levels-skirt__base")]
            if len(base_item) == 0:
                bool_flag = False
                print("levels-skirt__base")
                fail_text_list.append("levels-skirt__base")
                return bool_flag, sorted(list(set(fail_text_list)))
            else:
                base_item = base_item[0]
            if base_item == "Skirt2":
                if list_in_text(my_list, "skirt") == False:
                    bool_flag = False
            if base_item == "PencilSkirt":
                if list_in_text(my_list, "pencil-skirt") == False:
                    bool_flag = False
            if  base_item=="SkirtCircle" or base_item=="AsymmSkirtCircle":
                if list_in_text(my_list, "flare-skirt") == False:
                    bool_flag = False
            level_item = [item.split(connect_tag)[-1] for item in my_list if item.startswith("levels-skirt__level")]
            if len(level_item) == 0:
                bool_flag = False
                print("levels-skirt__level")
                fail_text_list.append("levels-skirt__level")
                return bool_flag, sorted(list(set(fail_text_list)))
            else:
                level_item = level_item[0]
            if level_item == "Skirt2":
                if list_in_text(my_list, "skirt") == False:
                    bool_flag = False
            if level_item == "SkirtCircle" or level_item == "AsymmSkirtCircle":
                if list_in_text(my_list, "flare-skirt") == False:
                    bool_flag = False
        if meta_item=='Pants':
            if list_in_text(my_list,"pants")==False:
                bool_flag=False
            cuff_type = [item.split(connect_tag)[-1] for item in my_list if item.startswith("pants__cuff__type")]
            if len(cuff_type) == 0:
                bool_flag = False
                print("pants__cuff__type")
                fail_text_list.append("pants__cuff__type")
                return bool_flag, sorted(list(set(fail_text_list)))
            else:
                if cuff_type[0] != "None":
                    if list_in_text(my_list, "pants__cuff") == False:
                        bool_flag = False
        if meta_item=='Skirt2':
            if list_in_text(my_list,"skirt")==False:
                bool_flag=False
        if meta_item=='PencilSkirt':
            if list_in_text(my_list,"pencil-skirt")==False:
                bool_flag=False
    meta_upper = [item.split(connect_tag)[-1] for item in my_list if item.startswith("meta__upper")]
    if len(meta_upper)==0:
        print("meta__upper")
        fail_text_list.append("meta__upper")
        bool_flag = False
        return bool_flag,list(set(fail_text_list))
    meta_upper=meta_upper[0]
    strapless=None
    if meta_upper =='FittedShirt':
        strapless=[item.split(connect_tag)[-1] for item in my_list if item.startswith("fitted_shirt__strapless")]
        if len(strapless)==0:
            bool_flag=False
            print("fitted_shirt__strapless")
            fail_text_list.append("fitted_shirt__strapless")
            return bool_flag,list(set(fail_text_list))
        strapless=strapless[0]
    if (strapless==str(False) and meta_upper =='FittedShirt')or meta_upper=="Shirt":
        if list_in_text(my_list,"collar")==False:
            bool_flag=False
        if left_bool == 'True' and (left_fittedshirt_strapless_bool ==False or meta_upper=="Shirt") :
            if list_in_text(my_list, "left__collar") == False:
                bool_flag = False
        sleeveless=[item.split(connect_tag)[-1] for item in my_list if item.startswith("sleeve__sleeveless")]
        if len(sleeveless)==0:
            bool_flag=False
            print("sleeve__sleeveless")
            fail_text_list.append("sleeve__sleeveless")
            return bool_flag,list(set(fail_text_list))
        sleeveless=sleeveless[0]
        if sleeveless==str(False):
            if list_in_text(my_list,"sleeve")==False :
                bool_flag=False
            cuff_type = [item.split(connect_tag)[-1] for item in my_list if item.startswith("sleeve__cuff__type")]
            if len(cuff_type)==0:
                bool_flag = False
                print("sleeve__cuff__type")
                fail_text_list.append("sleeve__cuff__type")
                return bool_flag, sorted(list(set(fail_text_list)))
            else:
                if cuff_type[0]!="None":
                    if list_in_text(my_list,"sleeve__cuff")==False:
                        bool_flag = False
            if left_bool == 'True' and (left_fittedshirt_strapless_bool == False or meta_upper == "Shirt"):
                if list_in_text(my_list,"left__sleeve")==False:
                    bool_flag=False
                #For the processing of the neckline, find the type of neckline and see if it is empty
                cuff_type = [item.split(connect_tag)[-1] for item in my_list if item.startswith("left__sleeve__cuff__type")]
                if len(cuff_type) == 0:
                    bool_flag = False
                    print("left__sleeve__cuff__type")
                    fail_text_list.append("left__sleeve__cuff__type")
                    return bool_flag, sorted(list(set(fail_text_list)))
                else:
                    if cuff_type[0] != "None":
                        if list_in_text(my_list, "left__sleeve__cuff") == False:
                            bool_flag = False
    return bool_flag,sorted(list(set(fail_text_list)))

def bool2text_alltext(text_list):
    flag = True
    no_in_textspace = list(set(text_list)-set(_ALL_TEXT))
    if len(no_in_textspace) > 0:
        flag = False
    return flag,no_in_textspace


