<commit_before>import sys
import subprocess

# Melissa
from melissa.profile_loader import load_profile
from melissa.tts import tts
from melissa.stt import stt
from melissa.brain import query


def main():
    data = load_profile(True)
    tts('Welcome ' + data['name'] +
        ', how can I help you?')

    while True:
        if sys.platform == 'darwin':
            subprocess.call(['afplay', 'data/snowboy_resources/ding.wav'])
        elif sys.platform.startswith('linux') or sys.platform == 'win32':
            subprocess.call(['mpg123', 'data/snowboy_resources/ding.wav'])

        text = stt()

        if text is None:
            continue
        else:
            query(text)
<commit_msg>fix: usr: catch OSError when using mpg123 (#169)<commit_after>import sys
import subprocess

# Melissa
from melissa.profile_loader import load_profile
from melissa.tts import tts
from melissa.stt import stt
from melissa.brain import query


def main():
    data = load_profile(True)
    tts('Welcome ' + data['name'] +
        ', how can I help you?')

    while True:
        if sys.platform == 'darwin':
            subprocess.call(['afplay', 'data/snowboy_resources/ding.wav'])
        elif sys.platform.startswith('linux') or sys.platform == 'win32':
            try:
                subprocess.call(['mpg123', 'data/snowboy_resources/ding.wav'])
            except OSError:
                subprocess.call(
                    ['mpg123', 'data/snowboy_resources/ding.wav'], shell=True)

        text = stt()

        if text is None:
            continue
        else:
            query(text)

{'fraction_non_alphanumeric': 0.11389236545682102, 'fraction_numerical': 0.011889862327909888, 'mean_word_length': 2.394904458598726, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3557016', 'n_tokens_mistral': 514, 'n_tokens_neox': 480, 'n_words': 124}