Skip to content

delta — yet another answering machine

License

Notifications You must be signed in to change notification settings

qwasa-net/delta

Repository files navigation

delta — yet another answering machine

a.k.a. Сверхъестественный интеллект или ёщё одна программа автоответчик

Super simple implementation of context-free regexps patterns matching algorithm.

No Machine Learning Algorithms or Neural Networks were harmed in the process.

Usage example:

    import delta
    d = delta.Delta()
    d.load_dictionary('dictionary.xml')
    output = d.parse('hello, world!')
    print(output)

Dictionary format:

<dictionary version="1.0">

    <!-- dictionary is a set of entries, each with patterns and answers -->
    <entry>

        <!-- any pattern must match -->
        <patterns>
            <pattern>hello</pattern>
            <pattern>good morning</pattern>
        </patterns>

        <!-- answer for the matched entry is selected RANDOMLY -->
        <answers>
            <answer>hi!</answer>
            <answer>hello</answer>
        </answers>

    </entry>

</dictionary>

Directory data contains some sample dictionaries, e.g. dictionary-test.xml.

Test bot: tg://delta_beta_bot

About

delta — yet another answering machine

tg://delta_beta_bot

Topics

Resources

License

Stars

Watchers

Forks