Ejemplo n.º 1
0
def feature_value_analyzer(value):
    value_list, feature_list, sounds = feature_listing()
    for feature in feature_list:
        individual_value = []
        for sound in sounds:
            if sound[feature] == value:
                individual_value.append(sound['symbol'])
        if individual_value and value:
            print(f"The sounds with the feature value \"{value}\" are {individual_value}")
def feature_analyzer(feature):
    value_list, feature_list, sounds = feature_listing()
    for value in value_list:
        individual_value = []
        for sound in sounds:
            if sound[feature] == value:
                individual_value.append(sound['symbol'])
        if individual_value and value:
            print(
                f"The sounds for which the value of the feature \"{feature}\" is \"{value}\" are {individual_value}"
            )
def sound_analyzer(analyzed_sound):
    value_list, feature_list, sounds = feature_listing()
    feature_values = []
    for sound in sounds:
        if sound['symbol'] == analyzed_sound:
            for feature in feature_list:
                if len(sound[feature]) >= 2:
                    feature_values.append(sound[feature])
    print(
        f"The feature values of the sound \"{analyzed_sound}\" are {feature_values}"
    )
Ejemplo n.º 4
0
def similar_sound_finder(analyzed_sound):
    value_list, feature_list, sounds = feature_listing()
    for sound1 in sounds:
        if sound1['symbol'] == analyzed_sound:
            for feature in feature_list:
                shared_feature_list = []
                for sound2 in sounds:
                    if sound1[feature] == sound2[feature]:
                        if sound1['symbol'] != sound2['symbol']:
                            shared_feature_list.append(sound2['symbol'])
                if len(shared_feature_list) > 1:
                    if sound1[feature]:
                        print(
                            f"The sound \"{analyzed_sound}\" shares the feature value \"{sound1[feature]}\" with"
                            f" {shared_feature_list}")
def sound_set_analyzer(analyzed_sound1, analyzed_sound2):
    value_list, feature_list, sounds = feature_listing()
    feature_values = []
    for sound1 in sounds:
        if sound1['symbol'] == analyzed_sound1:
            for sound2 in sounds:
                if sound2['symbol'] == analyzed_sound2:
                    for feature in feature_list:
                        if sound1[feature] == sound2[feature]:
                            if len(sound1[feature]) >= 2:
                                feature_values.append(sound1[feature])
    if not feature_values:
        print(f"The sounds \"{analyzed_sound1}\" and \"{analyzed_sound2}\" do not share any feature values")
    else:
        print(f"The sounds \"{analyzed_sound1}\" and \"{analyzed_sound2}\" share the following feature values:"
              f" {feature_values}")
def feature_combination_analyzer(value1, value2):
    value_list, feature_list, sounds = feature_listing()
    individual_value = []
    for feature1 in feature_list:
        for sound in sounds:
            if sound[feature1] == value1:
                for feature2 in feature_list:
                    if sound[feature2] == value2:
                        individual_value.append(sound['symbol'])
    if individual_value:
        print(
            f"The sounds with the feature value combination \"{value1}\" and \"{value2}\" are {individual_value}"
        )
    else:
        print(
            f"There are no sounds that are both \"{value1}\" and \"{value2}\"")